A fundamental problem in image recognition is to evaluate the similarity of two images. This can be done by searching for the best pixel-to-pixel matching taking into account suitable constraints. In this paper, we present an extension of a zero-order matching model called the image distortion model that yields state-of-the-art classification results for different tasks. We include the constraint that in the matching process each pixel of both compared images must be matched at least once. The optimal matching under this constraint can be determined using the Hungarian algorithm. The additional constraint leads to more homogeneous displacement fields in the matching. The method reduces the error rate of a nearest neighbor classifier on the well known USPS handwritten digit recognition task from 2.4% to 2.2%.