Added image flipping