I have written two games that do things like that: Pride or Prejudice and Northanger Abbey, and you are welcome to use the code if you can untangle the mess. But unfortunately I can't easily make an example game with this sort of functionality using Sprite Maker code.
Sprite Maker uses layeredimages, because they make the code relatively easy to read. But I couldn't figure out how to get a layeredimage to do all the things I wanted, such as changing based on a gender toggle. So Northanger Abbey, Pride or Prejudice, and the dollmaker within Sprite Maker, all use DynamicDisplayables instead of layeredimages.
You could turn a Sprite Maker sprite into a DynamicDisplayable but it would be a bit fiddly, and the final code would end up looking pretty different. I should probably write that up, along with how I use DynamicDisplayables in general, since some people might find it useful.
It's quite possible that there is a way to do things like this with layeredimages, I just don't know it myself.