Primal and Mixed Finite Element Methods for Deformable Image Registration Problems