imagep() and drawPalette(): better mai and mar [issue #196]