adding if else statement for checking photo