Automatically Generate a Photo Gallery from a Directory of Images: Updated

The photo gallery below was generated with PHP -- all that was given was the image directory!