What the is the best approach to achieve below mentioned scenario

In our application,

We have some list of images(linked with third party links)

I want to check that if i click on image it should load third party link properly without any error/issue

if image is not exists it should throw an error.

You can invoke a workflow and pass the link as IN argument. Create one OUT argument of type boolean.
In the invoked workflow, check for image exists or not by handling any error/issue in try-catch block.

If image exists, set OUT argument to TRUE else FALSE.

Karthik Byggari