checks width and height inputs for validity