Move image decoding out of the shader handler. It doesn't belong there.
Clean up the function macros. (Or does this make them even messier?)