Nipples very tender again

LJ • Baby girl born Feb 19, 2015 and second girl born Jan 20, 2017. Baby #3 due in October!
I'm about 19 weeks and have been breastfeeding since 11 weeks. All of a sudden my nipples have gotten very tender again and it hurts when she first latches on. I try to get her to latch on deep but it's still painful while she's eating just not as bad as first latch. Doctor says it isn't thrush. Bottoms are purple where her bottom gums hit them. I've been using nipple ointment but it's not helping.