Magento: Information about product pictures (small, thumb and so on), where in the DB?

Magento: Information about product pictures (small, thumb and so on), where in the DB?

July 19, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento: Information about product pictures (small, thumb and so on), where in the DB?

Magento: Where Does It Store Product Image Information?

Introduction

As a senior developer working with Magento platforms, I often receive inquiries about where specific data is stored within the database schema provided by this powerful e-commerce solution. One common question involves the location of product image information, such as the “small” and “thumbnail” versions used throughout the site.

In this post, we will delve into the Magento 1.4 database to identify exactly where these details are stored, ensuring you can optimize your data management processes for improved performance.

Understanding the Database Structure

Magento 1.4 uses a MySQL database with multiple tables to store various aspects of the platform’s functionality. Among these, several key tables relate directly to product information and media assets:

  • catalog_product_entity: Stores core product attributes.
  • catalog_product_entity_media_gallery: The primary table for product images.
  • catalog_product_entity_varchar: Contains additional text-based product attributes.

While these tables store a wealth of data related to your products, the specific image variants you’re seeking aren’t immediately apparent in any of them. Let’s explore further to pinpoint their location.

Locating Image Information

To find the image variant information (such as “small” and “thumbnail”), we need to examine another table within the Magento schema:

  • catalog_product_entity_media_gallery_value: This table stores the actual media files associated with each product. It contains columns for the file path and various sizes, including the original image and its derivatives.

Here’s a relevant SQL query that demonstrates how to extract information from this table:

SELECT
    main_table.entity_id,
    value_table.file_name,
    value_table.small_image,
    value_table.thumbnail
FROM
    catalog_product_entity AS main_table
JOIN
    catalog_product_entity_media_gallery AS gallery_table
ON
    main_table.entity_id = gallery_table.product_id
JOIN
    catalog_product_entity_media_gallery_value AS value_table
ON
    gallery_table.value_id = value_table.value_id;

This query joins the catalog_product_entity, catalog_product_entity_media_gallery, and catalog_product_entity_media_gallery_value tables to retrieve the product IDs, original image file names, and their respective small image and thumbnail paths.

Conclusion

In Magento 1.4, the image variant information for your products is primarily stored in the catalog_product_entity_media_gallery_value table. By leveraging the SQL query I provided, you can easily access this data to optimize your product management workflows or implement custom functionality within your extensions and themes.

Remember, it’s essential to always backup your database before performing any direct modifications to prevent potential data loss or corruption. If you require assistance with more complex database operations or need to integrate these findings into a larger development project, feel free to reach out to the expert team at Laravel Company.

Happy coding!

Magento 1 Catalog Database Performance

Our network