moved code from photos to index.erb