Resize image - logic change

Resize image - logic change