That's a good suggestion! Especially having a "sanity check" against a popular colour which should increase robustness when new images arrive.
Robustness is such a tricky subject, especially when the loss, i.e. the cost of returning a wrong image is fairly high. For fashion items the occasional odd colour is OK but accidentally returning naked people can be devastating for a product.
I want to stress that this code is massively simplified to avoid obscuring the main plot. There's so much we skipped: the code in the blog post actually computes pretty terrible results compared to an even moderately tuned pipeline :)