Help, caught my bf masturbating to my friends pictures

So me and my boyfriend have been dating for almost 10 months. We’re in a really good relationship, I love him with all my heart and he treats me well for the most part. So getting on to what happened, we were sitting on his bed whenever I looked at his phone and saw that there was one of my friends in his recently searched on Instagram. I asked him about and and he said something like “oh it was an accident, I clicked on her @ on someone’s Instagram story.” Immediately it felt off, I knew he was lying. I told him that that’s not possible, in order for someone to be in your recently searched you have to physically type in their name. He kept making excuses and excuses and finally I just let it go knowing that he was lying. I then just started ignoring him because I was so pissed. Eventually he asked me what was wrong and I told him that I thought he was lying. He then told me again and again that it was because he accidentally clicked her name. I showed him how it was literally impossible for that to happen and after talking to him more about it he finally fessed up to searching her name up. However he said it was to look at picture of me that she had on her account. I knew immediately again that he was lying so I ran to the bathroom crying. After about five minutes he came in there telling me that he only searched up her account to look at me and the girls soccer pictures because only her account has them. I asked him if it was just that why would he lie about it and he just kept saying “I don’t know I’m sorry”. I keep telling him that he’s lying and we get into a really big fight. I’m screaming and crying and he just keeps lying. Finally he says “okay fine, I saw one of her pictures and I thought she looked good”. my heart fell to the floor, I started bawling my eyes out and he was trying to apologize but I couldn’t even look at him. Eventually I put the puzzle together that he was masturbating to her pictures. I fell apart and all he could to was apologize and tell me how much he’s sorry and how much he loves me. I just kept screaming at him to leave me alone. Eventually I had his brother take me home because I couldn’t even look at him. What should I do? I’m so hurt, I’m already really insecure and this makes it so my b worse to know he’s thinking about fucking my friend. I love him a lot but this really fucking hurts. The fact that he lied about it makes me really suspicious that he might be messaging her or something. I don’t know what to do or say to him. Please help. Am I being to crazy or do I have a right to be mad?