The entire sentence forms an independent clause in this case. The subject is "who painted the picture." The verb is "puzzled" and the object is "the boys." There is no element that could be eliminated and result in a complete sentence, which is what an independent clause is.
One thing you should understand is that a subject or an object may be more than one word. Often, a phrase acts as a subject or an object. Let's look at a few examples:
Having a bowl of soup is my idea of a good lunch.
In that sentence, "having a bowl of soup" is the subject.
Whoever is going needs to sign up now.
In that sentence, "whoever is going" is the subject.
The key to identifying an subject, no matter how many words are involved, is to ask what in the sentence is performing the action. The key to identifying an object is to ask what in the sentence is having action performed on it.