return the image as an io object instead of a tempfile