Switching to use Raster instead of BufferedImage. Also, added scaling
for image arrays.