support for saving to file-like object in imsave