scaleImage method functional