Image is now rotated and inverted correctly. Still need to add bayer to RGB conversion.