Added image flipping.