added photoExists method