Fix photo function