Check this page out 2nd from the bottom, the bit of code creates the thumbnail images, adds a frame and shadow, spaces the images and makes an image map - from memory as it was a while ago since I did this
This reads all the images from the folder to create the "index" or you can add individual images:
exec("/usr/local/bin/montage image1.jpg image2.jpg image3.jpg image4.jpg image5.jpg image6.jpg -tile x3 mosaic/montage.jpg");
I have also done it with php using an array and looping through it.
The code can be modified and there are other methods you could use like -append or just create the images with Imagemagick and locate them on the page with html.
So many choices and options !!