Move declarations to function start
Don't crash when no camera