Refactor of direct link url in photo model to remove some unecessary code