refactored image scaling to ImageUtils