Resize and crop logic added