It's not so much my code that's inefficient, as it is the two Image::Magick calls for resizing and writing the image.
Thanks for your help everybody. I really appreciate it. I'll look into abusing signal handlers and forking, and see if I can't get them to let me use a little more cpu time. Though, that doesn't really help out if this eventually goes to other places that also impose cpu restrictions.