added support for flipping bgr to rgb