add RGB24 support, and fix flip issue on RGB32 input