Adding template images, and cleaning up code.