I found the problem. Works great!!! Thanks for all your help.
The error was caused by this:
Changed it to this and it works great!
One last question if I can bother just once more.
Is there a way to set the display order? Perhaps by date it was saved? If there are duplicates or triplicates of an image (with different file names...) it can be rather difficult to find them because they are spread out through the list. How does the script call up the order?