Some time ago I experimented with a gallery.
1. In index.php I defined $ tag_var4, $ tag_var5 and $ tag_var6.
In the gallery I added them as category, effect, or something else.
2. In the gallery I added a link to block / sb_galleryname.txt.
A similar structure like gallery.txt.
A, - Add additional data.
B, - Add adjacent data for gallery.txt.
3. You can create an add-on, expanding options for editor_images.php
For example: Creating a text box, inserting categories, effects, and so on.
See the link to paste text into pictures. Link here