How to push image variables to Google Tag Manager onclick.

I want to push the image title or description, for images used in my gallery, into the data layer, and into GTM, so that I can trigger events every time an image is viewed, and thus see which images in the gallery are most popular.

I work in the property sector, so this sort of insight is really valuable.

I can get the custom event to fire, but it’s just not passing the title or description variable with it… any chance anyone has faced this challenge before?

Thank you for any help in advance.

Elliot