Template code for processing images.