Azure Image Gallery / how to update end of life date or exclude from latest

We are setting up an Azure Devops Pipeline to create/maintain an golden image.
We are storeing that golden image into a Azure Image Gallery.

I our setup, we would just requiere the latest version and the former versions can be set to
exclude vom latest" or the end of life date can be set.

Any idea, how we can automate that?
Many Thanks