PicGrid is a project mainly written in JavaScript, it's free.
This is a jQuery plugin that creates a grid of images
PicGrid