implemented galleries and association of photos with resources