fixed get current photo query and optimized change condition
fixed existing photo url check