resize_image.sh script improvements