refactored to make photo hash less confusing