Enhancing Counterfactual Image Generation Using Mahalanobis Distance with Distribution Preferences in Feature Space