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
  • I've made a bit of progress on this. Inside \pub\media\catalog\product\ is an image folder. When the process runs, it tries to replicate the contents of image into the cache, but a lot of folders get skipped. I'm just copying the contents of image into cache\image to see if that rectifies the problem. Jul 22, 2021 at 15:35
  • Update some images have been restored, however different images are coming from different md5 hashed directories, so I'm having to upload a second copy of everything to see if I can at least get it working temporarily. Jul 22, 2021 at 16:54

1 Answer 1


Ok, this is a bit of a strange one and I have no idea how to solve this long term, however I've managed to restore all our product images.

I'm hosting the site with Siteground, who have a new option for "superfast PHP" which runs off a modified version of PHP 7.4

When image/<second_hash> is appended to the filepath on save, it's doing so based on the file parameters. In theory that same function would create the same encoded path when trying to retrieve the file.

However, the output of this function changes ON LOAD ONLY when this superfast PHP option is enabled, meaning that the save path and load path are now different causing the loss of images.

I've asked siteground for documentation, but they cannot/ will not provide it.

in the long term this means I have to maintain the entire system using the superfast option without knowing exactly whats changed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.