Sex and masturbation

My husband and I don’t have sex often. There’s been a lot of stress between us and I’ve gained some weight and he’s told me he doesn’t find it attractive. I’ve always been small and with a good body and he figured I’d always be that way, but I’m not and it adds to the stress. It bothers him more than me. Tonight I saw that he was masturbating to porn while I was at work. For some reason, it hit me so hard to see that. I felt so ugly and unattractive, when I know I’m not. I’m not sure how to feel or how to approach this. He was also watching porn he’d never admit to so I don’t think it’s a good convo. We’re very honest and open with each other, but idk. I just feel sorry that I’m fat now and not the person he once loved.

Please weigh in.

Am I wrong? What are your thoughts? Can this be solved?

Update-

The confrontation didn’t go well. He turned it on me and then said that he should have listened to his mom(she doesn’t like anyone her boys marry) and I replied I should have listened, too. (I was groomed to marry someone different than him). He said well no one wants you, not even a doctor(more like what I was raised to marry). You’re not pretty enough

And you’re not skinny enough. I think he has self confidence issues. I think he puts me down to keep me down at his level.

He would say that’s not true, but those are his actions. He constantly acts this way.