better handling of undefined photo