How to associate array of class probabilities with corresponding image in keras?
Keras Model.predict() method doesn't shuffle the data, so each row in p_valid corresponds to the row in x_valid. For instance, p_valid[2] holds the probabilities for the image x_valid[2].

By the way, note that the values in each row don't necessarily sum up to 1, because they correspond to the probability of class i being present, thus are not exclusive.