It's up to the challenge team about what to do now, but in the future, the best way to prevent that is to go into buy mode and move them off the easel, then hang them up. If they disappear, then you can just click undo and rehang them.
I read another tip for preventing it if you have paintings in the inventory, to drag them to another sims inventory, and then hang them, so I went to my previous save to check if that would work and it did. However, I was still missing the toddler portrait - or rather, the one I had labelled as toddler showed the child one. So I would have failed anyway with that save.
At least I learned this early and it didn't happen in a later generation! I'm starting over.
The way I understand the rules is that once you hang a painting in the official museum you cannot replace it, but I can hang portraits in the rest of the house until I decide, right? So instead of keeping them in his inventory until I decide which one I want to use, I can hang them on a wall and then later pick which to "officially" hang in the museum and move it via buy mode?