I want to click an image but there are two same images on the screen and click on image action fails.
How can I click on the first image without having the script fail?
Click on which image? That's why the action fails.
If you really want to force the issue, you can use a Find Image on Screen action to find the image, allowing for non-unique images, and then click at the resulting location.
For more information, see the wiki Searching the Forum for Answers section.