Yeah I cringed when I saw your pics.

Get your nitrates as low as possible by doing 50% water changes every other day. Then dose the mess out of that mag. But, only use Kent. Nothing else seems to work. Depending on your tank size it'll take a few gallons of the stuff to get your levels up.

After you see the stuff die off, maintain your mg level at the high level for at least a month. Make sure to watch your alk levels while your mg levels are high.

Best of luck. Please keep us posted.