Fake a StringIO to properly load the image in pillow