Based on the error message you are running into a shape mismatch in a linear layer, which is often caused by changing the input shape without using an adaptive pooling layer.
In case your model was working before without the webcam images, you should check the spatial shapes of the training and webcam images and make sure they are equal.