Absolutely. Get in good shape before surgery. Not just for appearance but also for health reasons.
I'd caution you however to only get in the type of shape you think you can maintain long term.
Too many people, including myself, get in awesome shape and then put the weight back on.
Get to an appropriate/comfortable weight and then get the surgery.