What if the memory limit's -1? And GD requires memory for the destination image as well.