You're probably over it by now. But yes that can be embarrassing. My mom caught me masturbating when I was 12 and I was so embarrassed then too.
I was in my room and I thought I locked the door and I was sitting there on my bed with some magazines and masturbating and in suddenly walks my mom.
I was naked and jumped under the covers and I yelled at her to knock next time and that I was getting dressed. But she said she saw me masturbating and confiscated the magazines.
They were my older brothers magazines. They had naked girls in the magazines.
You'll get over the embarrassment eventually. Every guy and teen,preteen masturbates and it's a normal natural healthy thing to do.
If I were a parent and walked in on my kid masturbating I wouldn't bring up the subject again.