BF: two bug fixes for ImageStim and new tests to prevent it in future

Might fix the problem with it not rendering on some gfx cards?

One was that the shader code was not correct - trying to use a 1D texture
instead of 2D. On my dev machine that caused the mask not to work but on
others might cause no image rendering at all?

The second was that the imagestim not being a lum image wasn't always
handled correctly (only apparent with a mask?)