Kidney pain is usually in your back. Right side upper abdominal pain near ribs can be liver or gallbladder but can also be ligament pain, and after 24wks baby can be high enough in uterus to kick ribs. But if pain is bad or you develop other symptoms it never hurts to give your dr a call.
With it being on your right side it could be your kidney i guess I actually have a uti and kidney infection right now but mine hurts more in my back
How far along are you? I'm 29 weeks and right below my ribs on my left side I get a pain its always really late at night and normally if I change my position it goes away buts it feels like a constant burning like she's laying on an organ and my doctor said she is probably pressing on my spleen