def add_file(type, file)
      media[type] = [] unless media[type]
      media[type] << file
    end
def add_file(type, file)
      media[type] = [] unless media[type]
      media[type] << file
    end
Helper to add a file to the media hash.