This plugin for jQuery will arrange your images resize images to fit in a container.