Testing for invalid values of width, height, numcomps (#1254)