Fix photo error

Fixed a possible null exception error with photos