PrestaShop Product Images: audit, URLs and an import workflow without broken images
POST /api/images/products/42
Content-Type:
multipart/form-data
image=@product-main.jpg
VERIFY → REORDER → CLEANUP
You have 4,000 products and a column called image_url. That does not mean you have 4,000 import-ready product images.
A reliable image workflow validates associations, availability, format, ordering, duplicates and failures.
1. The source URL is input
https://supplier.example/images/ABC001.jpgBefore import ask: does it exist, is it really an image, is it public, is the URL temporary and which SKU does it belong to?
2. Image mapping
| SKU | Image URL | Position | Cover |
|---|---|---|---|
| ABC-001 | .../abc001-1.jpg | 1 | 1 |
| ABC-001 | .../abc001-2.jpg | 2 | 0 |
| ABC-002 | .../abc002.jpg | 1 | 1 |
3. One product can have many images
Treat them as ordered records, not as an unstructured list of URLs.
4. Products without image associations
SELECT
p.id_product,
p.reference,
pl.name
FROM ps_product p
INNER JOIN ps_product_lang pl
ON pl.id_product = p.id_product
AND pl.id_lang = 1
AND pl.id_shop = 1
LEFT JOIN ps_image i
ON i.id_product = p.id_product
WHERE p.active = 1
GROUP BY p.id_product, p.reference, pl.name
HAVING COUNT(i.id_image) = 0
ORDER BY pl.name;5. Count images per product
SELECT
p.id_product,
p.reference,
COUNT(i.id_image) AS image_count
FROM ps_product p
LEFT JOIN ps_image i
ON i.id_product = p.id_product
GROUP BY p.id_product, p.reference
ORDER BY image_count ASC;6. Validate remote URLs
IMAGE URL
↓
HTTP CHECK
↓
CONTENT TYPE
↓
SIZE
↓
VALID / INVALIDSupplier URLs may expire, require sessions, contain signed query strings or block automated requests.
7. Duplicate URLs and cover rules
Check the same URL mapped to multiple SKUs and define a deterministic cover rule, for example position 1 = cover.
8. RAW and READY
RAW_IMAGE_URLS
↓
VALIDATE
↓
NORMALIZE
↓
ASSOCIATE SKU
↓
ORDER
↓
READY_FOR_IMPORT9. Post-import audit
Compare expected image counts with actual imported counts and produce a REVIEW/FAIL report.
Images are data: they have identifiers, associations, ordering and validation rules.
Next step
Add image validation to the supplier-feed transformation pipeline, before producing the final import file. Preserve the expected image count and URL status alongside the CSV product import log so post-import reconciliation is measurable.