R-Script for scaling images