Added support for flipping tiles