If while thinking of ALLAH swt some image comes in your mind or you imagine something but don't believe it as the image of ALLAH swt . Then is it okay? Or it is shirk ?

You should not imagine anything as the image of Allah because Allah is unlike anything. If something comes to your mind unintentionally then you should dismiss this thought as an evil thought that has no basis.