I use Smaller ANimals Thumbnailer. It will calculate the number of images and put however many images to telll it to per page. You can build templates with it, and it has it's own proprietary scripting language so you can integrate some interesting randomization or information features that other things don't give you. and it can sort everything into subdirectories for you too. and the images can be branded and manipulated from within the program, and it's fast (on my p166), and cheap ($25 i think), and tiny (less than 3mb).
Download it