whoever bought the images
Depends on the contract between the agency and client.
Who is responsible for licensing images, the agency or the client?
Who is legally responsible if the images were used and not licensed?