The output stream is closed && gif images are not saved