PreProcessing of images