add optional support to export jpeg files

Not supported on Android.