The error in cell20/21 is created by the wrong usage of the labels tensor:
img = img.to(device)
log_ps = model(img.unsqueeze(0))
test_loss = criterion(log_ps, labels)

While you are loading a single image and unsqueeze the batch dimension, which is fine, you are reusing labels from previous cells (most likely from the test DataLoader).
Instead of reusing labels you should either load the target for the current image you would like to classify or skip the loss calculation, if the target is unknown.
I think the second error might be related.
Let me know, if that helps or if you need more information.