Hi and welcome to BB. So sorry to hear about the loss of your precious baby.
Regarding your pains - Did the placenta come out intact? I too was having pains after I lost my little boy at 21 weeks and it was discovered that I had a swollen uterus, retained products and an acute infection which required 2 curettes and almost 7 weeks of antibiotics to cure - but before that was diagnosed I was also told it was my uterus contracting and shrinking back. Ask your OB to give you an ultrasound or get a second opinion. Good luck hun and sending you lots of hugs. I hope the near future brings you your much deserved baby x