added template for function to save a copy of the image