Views remove link to content based on publication status
With Views's support for Twig, you can now implement conditional hyperlinking without any hook modification to your view. 


Add a Content: Path field to your view with Exclude from display checked.
Add a Content: Publishing status field to your view with Exclude from display checked, using the True/False Output format.
Add a Image (field_my_image_field:target_id) relationship to your view that targets your specific image.
Add a File: URI field to your view with the Exclude from display checked, using the File URI as the Formatter, and the Display the file download URI checked.
Finally, add a Global: Custom field with custom Twig that can check the publishing status value for displaying the link and use the excluded fields as replacement patterns.


For example:

{% if status == 'True' %}
&lt;a href="{{path}}"&gt;
  &lt;img src="{{uri}}" /&gt;
&lt;/a&gt;
{% else %}
  &lt;img src="{{uri}}" /&gt;
{% endif %}