Media Gallery image optimization

Last update: 2023-08-29
  • Created for:
  • Beginner

The new Media Gallery provides an image optimization feature, which improves performance and decreases media file sizes on the storefront. This optimization is enabled by default and can be modified in the store configuration settings.

Configure image optimization

  1. On the Admin sidebar, go to Stores > Settings > Configuration.

  2. In the left panel, expand Advanced and choose System.

  3. Expand Expansion selector Media Gallery Image Optimization and do the following:

    • Set Enable Image Optimization to Yes.
    • Enter the Maximum Width and Maximum Height values (in pixels) according to your needs.


When Media Gallery image optimization functionality is enabled, an optimized copy of an image is automatically inserted in the content from the Media Gallery instead of the original file.

When the Maximum Width and Maximum Height values are changed in the configuration, it updates all the existing optimized images that were previously inserted.

The Media Gallery Image Optimization requires that the queue consumers are running for regenerating optimized images when configuration is changed. See Manage message queues in the Configuration Guide for more details.

On this page