Minor changes to image preprocessing