Fixing unable to delete GIFs, stream never closed