update image glyph to accept both 1d and 2d arrays