UI Compas tracking wrong axis

I am trying to use a UI image to point towards my game objective in a topdown 3d style setup, the issue I am having is my compass is only half working and is tracking my object on the x and y axis instead of the x and z.

Any ideas or hints where I am going wrong?

        Vector3 compasImage = target.transform.position;
        transform.LookAt(transform.position + transform.forward, compasImage - transform.position);

Try changing transform.forward to transform.right

Thank you for the reply I have tried that but when I use .right my image becomes very jittery and although it does track the axis when it does it transforms the UI image on the wrong axis .

What I think I am trying to do is track the object x&z and transform only the images z rotation