Depending on your Purchase and sales agreement and how the mortgage contingency reads, you may be entitled to back out or renegotiate. Without a Realtor, it's hard to say what you signed. I hope you had an attorney represent you for the P&S at least.
As for the right thing to do.? You need the mortgage to buy the home. An apraisal is meant to protect the bank from lending on an overvalued property. It can also protect you as a buyer. There is no shame in not willing to over pay for a property, but you need to consult a Real Estate attorney to make sure you are not breaching your contract in any way.