This seems relatively tricky.
One way would be to use the Caption or Description meta box in the Image Uploader to store a class name, and then output it like this
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" class="<?php echo $image['caption']; ?>"/>
Or you could output a generic class for all images
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" class="gallery_images_class"/>
and then use a css :nth-of-type selector to target specific instances (eg. images 4, 7 out of 10)
You can use the Custom Post Type UI plugin to generate your custom Taxonomy https://en-ca.wordpress.org/plugins/custom-post-type-ui/
And then you can refer to this tutorial to add custom fields to that taxonomy
https://www.advancedcustomfields.com/resources/adding-fields-taxonomy-term/