I don't really understand why the palletes are messed up.
If you noticed, in LoG, everytime the first picture appears, there's a slash of the picture box, then gone, and then it appears again.
That was my temporary way of fixing it.
The first picture always has a messed-up pallete, but the following ones won't.
So, picture appears, hide it, and then show it again.