Fixed problem with having additional no image files.

Also fixed is the logic. You now make only one check (not every time)
with regular expressions to find all the image files.