ABOUT
I have a website where users can upload photos to their profile so that other people can see them. Then, when people view each image, I show the image in the middle. Above the image there is information about the user who uploaded the image. The URL of each image will look like this: http://website.com/image/id
Problem
I want people to use the above image address in the html image tag (<img src="http://website.com/image/id">) on other sites / on their own website
So far I have a function that if they add "/ img" after the URL ( http://website.com/image/id/img ) and copy and paste it into -tag it will work, but if possible I would do the job in such a way when the image uploaded by the user is displayed as usual, but when it is loaded using -tag with this URL: http://website.com/image/id , this will display the image correctly. (without html and with "header image / png").
What i tried
As already mentioned, I already have the ad / img option after each image, so you can use it and embed it on your website using -tag. I looked at $_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'], $_SERVER['SERVER_ADDR'] to make sure this worked. But this will not work because call it your ADDR server and NAME. Because of this, REFERER will work in this case, but if the visitor visits only the image and does not view the entire site, he will display the image without information about the download / file.
Then what?
I searched for such cases, or there is no such case, or I do not know correctly what to look for.
In short
I need a way to determine if a website is displayed via -tag on another website, then to show a different and correct image to use. Since at the moment, if the user copies & paste http://website.com/image/id into -tag, this will only result in an error.
Note
I hope you guys can help me, I tried to make it clear what I'm looking for and what I tried. If not, please let me know. Sorry if some of the above contain misspelled words, incorrect grammar, or are poorly explained. I do not speak English daily, but I try my best.