See this video on Image Factory pattern. This scenario is an advanced scenario, and the scripts provided are sample scripts only. If any changes are required, you need to manage and maintain the scripts used in your environment.
For detailed information on creating an image factory, see Create a custom image factory in Azure DevTest Labs.