If a stream is passed to imagepng() or other image output functions, opposed to a filename, we must not close this stream.