← Back to Blog
PHP Magento

Magento 2: Images don't show in media gallery? Here's the fix.

Sean Breeden February 7, 2025 4 min read
Magento 2: Images don't show in media gallery? Here's the fix.

If images aren't showing up in any of the admin Media Gallery previews, then all you need to do is run the following commands:


php bin/magento media-gallery:sync
php bin/magento media-content:sync


The media-gallery:sync command may time out at the command line. If it does, add the following line at the top of app/bootstrap.php.


php_value max_execution_time 3600


Increase this number until the command no longer times out.


About the Author

Sean Breeden is a Full Stack Developer specializing in Mage-OS, Shopify, Magento, PHP, Python, and AI/ML. With years of experience in e-commerce development, he helps businesses leverage technology to create exceptional digital experiences.