remove an unneeded check when terminating the stream for JPEG writing.