Updated to use rmagick for image processing