fix patient photo retrieval bug