impl flip and camera selection logic