Setting a UI Element to the mouse position

When setting the image position to the mouse position the image falls behind but does reach the location of the mouse. Not sure what is going on. Can anyone explain.

using UnityEngine;

public class Position: MonoBehaviour {

    public GameObject image;

    void Update () {
        if(Input.GetMouseButton(0))
        {
            image.transform.position = Input.mousePosition;
        }
    }
}

Have you tried playing with the anchors and pivot of the object you are moving?

@osybear

Mouse coordinates are in screen space, Image in any canvas is using RectTransform / canvas coordinates.