imagep() imrpovements re issue 372