Zend certified PHP/Magento developer

Product Catalog Images URL construction

I have a rather strange issue on Magento 2 (2.3.3) where product images are not loading.

Grid and List view show an error 500 for (some) product images, which seem to have additional slugs versus what most Google search results show for a Magento 2 install. Some main product images do however work, even if their thumbnail in the grid / list view does not

As an example I get

https://www.<domain>/pub/media/catalog/product/cache/<md5 hash>/image/<second_hash>/<filename>

An example of the second hash is 132880d36, and these are part of the URL on all product images.
Some however work, others return an error 500 as the image in the directory with the secondary hash doesn’t exist.

I cannot find any documentation on where this additional /image/<second_hash> portion of the URL is coming from, so I’m not entirely sure where to even start.

I can confirm the following has not resolved the problem

  • php bin/magento catalog:image:resize
  • php -d memory_limit=5G bin/magento setup:di:compile
  • Flushing all cache’s including the product catalog image cache
  • Restoring image cache from a backup only overwriting duplicates