[python] How to write PNG image to string with the PIL?