To much weight gain???

Pre pregnancy I weighed 142 pounds and am 5ft 7in. I'm 30 weeks and now weigh 174. I've gained 32 pounds 😱😱 is this too much? I'm walking every night, not the healthiest eater but I do okay. I'm changing my diet from today but just wondering if it's too late? Can I lose weight or at least control it for now?