Is there a package (or algorithm) to generate a PDF with images and captions like in a catalogue or an image gallery? Several images of about the same size (resizing to max width or height, with aspect ratio intact) on each page and each page contains the same number of images. If the images could be retrieved from a directory would be good. Not sure how one could get the captions for each images, though. Also it would be good if the line breaks would not be hard coded so you could add an image in the middle of the document and it automatically regenerates the pages. If this is not possible directly with LaTeX I might have to write a script to generate the code.