added try catch for Photo()