I had the same issue when trying to use the default GD2 image handler. I ended up compiling and using ImageMagick and the problem went away.

I even snagged the latest and greatest GD2 source and recompiled that, still no joy.