Bugfix: we were imagedestroy()'ing the wrong variable