add optional flipped param to pil image save

This fixes export_to_png with kivy for me.