add saveImage method