It looks to me that either you have strained rib cage
or may be there is a rib fracture
. As you are pregnant i would not suggest you to take painkillers( only if your gynecologist permits).
My advice to you is to avoid sleeping in that side.
Apply Diclofenec gel locally
Hot water fomentation will help.