Attaching an image to the mouse pointer is kind of simple.
I have attached the onmousemove event to the document so the image element always follows the mouse pointer.
In the image element I use the onmouseover event listener to assign an image to the image element and make it visible.
And I use the onmouseout event listener to make the image element invisible.