make imagep() and drawPalette() more similar on margins [issue 295]