I think there is problem in code line 157, 194 and 261. I did exactly as you instructed.

I did a test now and the same thing appeared to me...

Take another test. Enter a topic that has images. Choose the "all" option for the entire topic to be loaded. Then run the script.