fix export_to_png with img_sdl2

Fixes #2659 by flipping the texture before saving.

Also fixes the offset error displayed in that image - but I'm not sure this is a good fix. I don't know why I need to offset by 36 bytes, and I don't know if it will always be 36 bytes or if this should be calculated somehow. Feedback on this would be appreciated. :)