Release memory used by GD after the image resizing has ended #2310