Agreed. Can't recommend HTML::Template enough. Recently created a image album system that allows the user to upload images after creating an "album", with description, to put them in. They can select size and optimization level, and enter a caption. Everything is stored in a MySQL db and GD handles the thumbnails and sizing (though not happy with the quality of the optimization, even in a 2.+ version).
H::T allows me to just plug the image path and caption for each image, keeping the HTML entirely separate from the Perl/CGI. So, you can design your HTML document the way you want it to look, per
barrd's suggestion, and then drop in the H::T "placeholders" for the images and captions.
Sample site