It's not unusual for hamsters to have impacted pouches. A vet would need to take a look, remove the source of the problem, flush the pouch and possibly administer an antibiotic depending on the infection.
This is just part of what we need to expect when we adopt these little guys. It's very good of you to have noticed before it got so bad that his eyes swelled shut (this happens too!), or worse.
When you take him to the vet, make sure it's in an air conditioned car, directly to the doctor and directly home afterward. In the hot weather we've been having around the country, heat stroke is a serious threat to these little hammys!
Good luck with him. I think he'll be fine once the doc see him.
__________________
You remain responsible, forever, for what you have tamed.

