add optional flipped param to pil image save

This fixes export_to_png with kivy+pil for me.