weight gain and food choices

Sara
I'm having a really hard time finding balance with my food since the holidays . 
I've been in this sugar / carb cycle and it's not good. I had an eating disorder for ten years between 11-21 - now I'm 32 and have always struggled with self image and controlled it by working out hard and counting calories . 
Now I'm pregnant and I'm so happy and can't wait to meet our son after needing  fertility treatments for an ovulatory disorder.
But the scale keeps going up and I'm ok with that knowing I have to gain weight for the baby  .  But - I feel totally out of balance with my food and I've gained 22 pounds at 28 weeks . I wanted to only gain 25 which is obviously not going to happen . Now I'm hoping to gain no more than 32 . 
I'm spiraling with the sugar and feel guilty for putting that In My body because the baby suffers and then I feel guilty for feeling upset about how fat I've gotten because the only thing that should matter is this baby . 
I'm not sure what to do . I'm just feeling so guilty about the food and also feel like a bad mom both for eating too much sugar when it's impacting my baby and for caring so much about my food and weight gain . 
 Sorry if this sounds nuts . I'm just hormonal too and don't think that helps . 
Anybody have tips on how to find balance ? Anybody else  trying not to freak out about the weight gain ?
I'm trying to at least log my food lately and balance it out with healthy things and also am working out still although I can't do the workouts I used to do anymore .