This is an example template.html file located in the same directory as index.cgi. You can create or edit this file with any html/text editor that you like. Just make sure you keep the "content" tag in the source for the file. This tag will be replaced with the output of the index.cgi.
Completely customizing this script to match your site is as simple as getting one of your other pages (header, CSS, and all) and putting the content tag in the body where you would like for the pictures/galleries to be. To find out what is meant by the "content" tag, simply look t the source code for this page (template.html).