Fix a bug in getting photo data