Use gdImageDestroy instead of gdFree on gdImagePtrs