fix zero result bug when searching photos
refactor the specs