Hardworking and always trying her best are serving as adjectives modifying the painting, not the girl. As of the last time I checked, paintings do not have a gender, and thus this sentence would be incorrect.
Meh. I would give half marks XD
He said the painting is hard working and always trying
her best. Firstly, a painting doesn't work for anything, its the artist who does the work. Also, he called the painting a her. I do understand in some languages nouns can be masculine and feminine (French is one of them), but I don't think that rule applies to the english language. You gave an answer first, but it felt a bit lacking to me.
EDIT: Actually, reading over your response, I caught a mistake. your explanation " Hardworking and always trying her best are serving as adjectives modifying the painting, not the girl." shows you think that adjectives can only be used on people, not things, which we know is not true. I don't know if you just stuffed up your explanation or what but you got a problem in your answer.