Sounds like the hack you are using ought to be rendering a thumbnail instead of working with the full size image. Both GD and Imagemagick have utilities to convert images to thumbnails and I'm guessing a hack has already been done that you could add to yours. I know for sure a few utilities are here that do image processing. May be you should check into something like that ?
HTH
|