During the English Google SEO Office-Hours From November 5, 2021, John Mueller addressed a question about images. The video below is queued to the spot where he read the question.
I’ve edited the scenario this person described:
“I have portfolio-style sites with pages each showing 10 to 30 thumbnails displayed in a gallery and in full size when clicked.
“Depending on the CMS plugin used, the full-size image is or is not included in the page HTML. So, for instance, we have a kitchen URL showing a portfolio. The plugin has a feature that you can load kitchen?image=123 and it’ll load exactly the same page, but JavaScript will open a full-size version of the image, providing a sort of unique URL for a page for that image.
“In reality, there’s only one page containing the entire image set and it’s only JavaScript that is making that work.
“Do you advise in on considering each image having its own page and listing it in a sitemap, or should I canonicalize them all to the main kitchen page and list only kitchen in the sitemap, as in reality there’s only one HTML page there?”
John’s response, which I’ve edited for clarity, was:
“So, in general, I would treat these as unique pages if, when the page is loaded and rendered in the browser, it shows something unique, then it’s a unique page even if that’s done with JavaScript.
“So we do process JavaScript. Yo can test that with the Inspect URL Tool, and you can double-check to see what Google is actually seeing.
“The one place where I would tend to say it’s useful having a separate image landing page is if you care about image search, and for image search, having something like a clean landing page where, when a user enters a URL, they land on a page that has the image front and center, maybe has some additional information for that image on the side, that is really useful, because it’s something that our systems can recognize as being a good image landing page, and whether or not you generate that with javascript or with the static HTML on the back end, that’s more up to you.
“But essentially, the aspect of having a unique image landing page is something that really helps when it comes to image search, because otherwise, if we just have this portfolio page with 30 small thumbnails on it, and someone was searching for an image, it’s hard for us to say, ‘Well, you’ll find the information you need on this big landing page with lots of images on it,’ because chances are, the image is somewhere where they don’t see it offhand, and they’d feel kind of confused if we sent them there after searching for that image.”
Do This (What’s Mentioned Above) If You Care About Image Search
“The thing with image search is that it works kind of separate from normal web search, and not all sites care about it. It’s not the case that if you have good performance in image search, that you’ll have better performance in web search.
“You can essentially treat these as separate things, and from that point of view, if you only care about web search–if you don’t really need these images to be visible in image search–then this might not even be something that you need to care about, so I think those are kind of the different options there.”