Updated camera detection code