Fixing bug when animating at a size larger than the image