Fix flipped images on OS X.
Merge branch 'master' into imageRep
Merge branch 'imageRep' into arc