Sore nipples while pumping

Kiley
So I've been on a roller coaster since my baby boy was born three weeks ago. He doesn't latch and blood sugar levels were dropping after birth so had to supplement with formula. Decided to pump since he doesn't match but I'm not producing enough to be exclusively pumping so we still supplement. I went back in the hospital after a week due to high blood pressure. After two tests, I had to pump n dump from Tuesday till Sunday. Once I was able to give him my breastmilk it still wasn't enough to EP. Then my son started projectile vomiting for 5 days and didn't keep either breastmilk or formula down. Turns out he had pyloric stenosis and has surgery yesterday to correct it. We just got home today. But my point in all this is to ask -- why are my nipples in pain when pumping? So much pain to where I can't pump longer than 10 minutes anymore. I was doing 20-25 min total but now I can't stand the pain so I stop early. My nipples aren't cracked and they glide in n out while pumping without chafing. They are a little red but only when they are being pumped. Now that my baby can hold food down I want him to have my breastmilk more than formula. So I don't wanna quit but can't stand the pain. Help!! What could it be and how do I fix it?? Tia