adding image preprocessing