Upon the coming in of the report of sale, the court shall grant an order confirming the sale, or, if it appears upon due examination that justice has not been done, it may order a resale on such terms as are just. If the sale is confirmed, the sheriff shall forthwith execute the proper certificate of sale, which shall be recorded within 20 days after such confirmation.