add metadata and thumbnail