added comments to image resizing