updated photo functionality for index and show pages