PhotoFolio is a web-based image gallery written to run on ColdFusion. This is a mature application with patches and updates since its original codebase was written in 2001. It handles categorization of images as well as automagic generation of thumbnail images for the gallery. Check it out.