Fixed encode_blob when a StringIO is present for "file" instead of an s3
object