How to automatically print multiple images per page?

Using an Ubuntu linux, what is the best/easiest way to print multiple images per page?

The global number of images and pages and the requested number of images per page should be dynamically chosen.