Use the raw integer photoId in more places
fix a ClassCastException