add null check to photoUrl