As you can see in the last code snippet, uploadButtonController.onUploadDone() function will give you the uploadedFileMeta. You can save the uploadedFileMeta in your database gallery using Wix Data:
https://www.wix.com/velo/reference/wix-data/introduction
E.g.
```
const { fileUrl, mediaType } = uploadedFileMeta;
wixData.query("SomeDB", "00001")
.then(result => {
result.gallery.push({
src: fileUrl,
type: mediaType,
});
return wixData.save("SomeDB", result);
});
```