LPS-33007

Heya Iliyan, theres a bug (from before my changes) where if the palette is not on the page, the entire thing breaks.
I would prefer if we could keep all of the logic for dealing with the palette somewhat separated since it may or may not be on the page, and it would be easier to switch that handling on and off.

Thanks Iliyan