reorganize buildPhotoDictionary