Just saying this because I'm still proud about it and it's relevant:

https://github.com/tgstation/-tg-station/pull/1296/files

Female outfits use runtime generated cached icons based on the default outfits. Every outfit is generated but once even if multiple people wear it, and every player downloads the shirt immediately on creation of the shirt so there's no bizarre pop in problems.

It would not be hard to ape that system for your needs or (better idea) generalize the proc so it could be used for all sorts of things.