refactored phPhoto model and PhotosController to Gram and MediaController, respectively