YABU - I've worked in galleries the last 10 years.
Your way of experiencing an artwork is just one of many, and is not the 'right' way. There's no such thing. There's whole SWATHES of theory that say viewing in the way you describe is symptomatic of the worst aspects of capitalist culture.
All anyone who works in one wants is a visitor to have is a meaningful engagement with the art. What that means is very different for different people, for different art, different places, etc etc. Families with kids shouldn't be hushed as if the only way to enjoy and experience art is in silent reverence as if it's some holy icon. They can chat, laugh, tell stories, be animated, whatever!
Similarly, if someone wants a record of themselves with art that means something to them, that's a nice thing. Our phones are visual diaries nowadays. I'm not a selfie-taker but the half dozen or so I've ever done are in front of artworks that I've loved.
There's obviously a whole debate about selfie culture as a whole - needing to validate an experience by documenting it. When I went to the Louvre for the first time as an adult about 8 years ago I made the 'pilgrimage' to the Mona Lisa. I honestly couldn't believe what happened - everyone facing with their BACKS to this masterpiece so they could take selfies. It was unbelievable.
So, there is an issue in there, but that's not about galleries, that's about selfie culture.
In galleries, people should be free to engage how they want. Someone interrupted you in your engagement, but it clearly wasn't deliberately rude, and you could have gone back and looked again.