script for scaling images