title: Redirect image to post url
body: <p>I've seen some websites in google images when you click "open image in new tab" it redirects to the url of the original post.</p>
  
  <p>I have my website that has a lot of images created with php gd which take the data from the post and create the image, the url it's similar to this: </p>
  
  <p>example.com/img/(number-post-id)-some-text.jpg</p>
  
  <p>and the post its </p>
  
  <p>example.com/post/(number-post-id)</p>
  
  <p>It's there a way to redirect the images to the original post when somebody open the image in a new tab?</p>
  
  <p>thanks</p>