validate width and height