E.,
There are a lot of reasons why your son could be banging his head when upset. Yes, he could be imitating what he sees on tv or he could just be one of the children that bangs his head when frustrated, which believe it or not is normal. See an excerpt from an article by Dr. Greene below or check out the website at http://www.drgreene.com/21_1104.html.
"Some kids bang their heads out of frustration or anger, as in a temper tantrum. Head banging is an effective attention-seeking maneuver. The more reaction children get from parents or other adults, the more likely they are to continue this habit.
Generally, healthy children do not head-bang in order to injure themselves.
Who gets it?
Up to 20 percent of healthy children are head-bangers for a time. Typically, head banging appears in the latter half of the first year of life and generally ends spontaneously by four years of age. Boys are three or four times more likely to be head-bangers than girls."
Also, on a side note, if you love Harry Potter books than you will love this new book called, "One Wizard Place" by D.M. Paul. Check out the web site...http://www.onewizardplace.com.
I hope this helps.