Mat = {{ 0, -Cos[k x], pm Sin[k x]},
{k,0,0},
{0,pm Sin[k x], Cos[k x]}
};
Mat//MatrixForm

Img = Mat.{x,y,z};
Img //MatrixForm

(* Gradient of function *)
Gr[f_] := { D[f,x], D[f,y], D[f,z]}

Gr[x^2+y^2+z]

Gr[ Img[[3]] ] + pm Img[[1]] Gr[ Img[[2]] ]

Simplify[%]

(* pm = +1 or -1 *)
%/. {pm^2 -> 1}