Actually, in your example, no one would be criminally liable because that's not illegal. See: Ashcroft v. Free Speech Coalition (2002)
The SCOTUS ruled that simulated/fictional depictions of minors don't count as CSAM. However, if the artist painted the likeness of a real child, they'd be liable though I'm not sure if the person who hired them would be if they never accepted/maintained ownership of the painting.