now accepts StringIO instances of image data