Working the functions ImFlipH and ImFlipV for .pgm and .pbm formats