Run this script in a web directory consisting of all or mostly image files. It'll create an index.html of thumbnail images, putting the thumbnail files in a hidden subdirectory.
It avoids unnecessary work by comparing the dates on already existing thumbnail files and not re-creating them if the corresponding original has not changed.
It also refuses to overwrite an index.html file not created by this script.
Here's a sample.