Customizing titles in Lesson 1 Dog/Cats model plots

Sharing if anyone is interested and/or can recommend a better way to make the titles in the dog/cats model reflect the model predictions:

imgs,labels = next(batches)
predictions = vgg.predict(imgs, True)

class_names = batches.class_indices.keys()
titles = ([class_names[ci] for ci in predictions[1]])
plots(imgs, titles=titles)