A man showed a "fascination with violence" after posting a picture of himself on the Internet wearing a balaclava and waving a gun.
Dean Lissenden, 21, was arrested after an anonymous person sent the pictures downloaded from a website called Bebo to police in Didcot, Oxford Crown Court was told yesterday.
Lissenden admitted possession of a firearm and was in breach of his licence after being released early from jail in August last year, prosecutor Clare Tucker said.
Recorder Joanna Greenberg said: "It shows a fascination with violence.
"Some people find it attractive to pose in a way which appears to be aggressive and violent."
Terence Woods, defending, said Lissenden did not know the Walther air pistol was classed as a firearm or breached his licence conditions.
Lissenden, of Kynaston Road, Didcot, was given a 12-month suspended sentence and ordered to carry out 18 hours' unpaid community work.