I wrote a script that creates thumbnail galleries I can put in a blog. I made it so I can just upload images into their own directory, invoke the script with a .php include, and it will make all the thumbnails and the gallery for me. Following is an example gallery from the script.

The main script is here and the library script it uses is here. You are free at least to use the former for any purpose; I saw no restrictions on the latter by the person who wrote it.