At the point of training it was viewing images that the artists had published in a public gallery. Nothing pirated at that point either. They don't need "permission" to do that, the images are on display.
Learning from art is one of the previously-established purposes you speak of. No "derivative work" is made when an AI trains a model, the model does not contain any copyrightable part of the imagery it is trained on.