Do I have the right?

I was in a casual relationship with a guy for about 6 months. He had a habit of being super present, friendly and affectionate at one point, to being being a complete condescending a-hole and disappearing for days at the drop of a hat. When we started having sex we agreed that it was just sex, but if we started having sex with someone else, we’d let the other know and decide how to move forward.

There were multiple occasions where he would do things to make me mad (break plans with me to hang out with friends, disregard things I said, or say things to lower my self-esteem). One day, he sent me a whole bunch of pictures of half naked girls on tinder he was trying to match with, and I got offended because 1. Why is he showing me this? And 2. When I asked what the point of him showing me all the girls he’d like to sleep with me was, his reply was that I had no right to be mad and he didn’t care about my problems and if I didn’t like it I didn’t have to stick around. So I didn’t.

The question is, was I justified in my anger, or was I really just being crazy?