def create_fragment_photo(page_part_key, block_label, photo_file)
      # content_key = self.slug + "_" + page_part_key
      # get content model associated with page and fragment
      page_fragment_content = contents.find_or_create_by(page_part_key: page_part_key)

      if ENV["RAILS_ENV"] == "test"
        # don't create photos for tests
        return nil
      end
      begin
        photo = page_fragment_content.content_photos.create(block_key: block_label)
        photo.image = photo_file
        # photo.image = Pwb::Engine.root.join(photo_file).open
        photo.save!
      rescue Exception => e
        # log exception to console
        print e
        # if photo
        #   photo.destroy!
        # end
      end
      photo
    end
def create_fragment_photo(page_part_key, block_label, photo_file)
      # content_key = self.slug + "_" + page_part_key
      # get content model associated with page and fragment
      page_fragment_content = contents.find_or_create_by(page_part_key: page_part_key)

      if ENV["RAILS_ENV"] == "test"
        # don't create photos for tests
        return nil
      end
      begin
        photo = page_fragment_content.content_photos.create(block_key: block_label)
        photo.image = photo_file
        # photo.image = Pwb::Engine.root.join(photo_file).open
        photo.save!
      rescue Exception => e
        # log exception to console
        print e
        # if photo
        #   photo.destroy!
        # end
      end
      photo
    end
used by page_controller to create a photo (from upload) that can
 later be used in fragment html