Bash script to scale down an image