Make the code slightly more functional by adding image transformations.