Added image preprocessing