Google Images - Remove frame?

Hello everyone, I run a humor site with funny pictures on it, and recently I started receiving hundreds of people from google images, but I noticed that there is almost no use of them, they just take the picture and just bounce, i’ve read that there is a way to remove google frame on images search results but some SEO say that it will hurt the page’s SRP, I’m confused of what to do, keep receiving useless google img traffic or do something with it, please if anyone could suggest some way out It would be of great help!

You want a “Get out of frames free” code: this bit of Javascript will do the job.

if (top.location != location) {
    top.location.href = document.location.href ;

What that says is that if the window/tab URL is not the same as the current document URL then load the current document in the window/tab.

Thank you Stevie D! But is it ok to use this js code ? Will google penalize for this in serp?