SELECT 
  PI.product_id, 
  F1.id AS file_id, 
  F1.path AS file, 
  (
    SELECT 
      PI1.alt 
    FROM 
      `cscart_products__images` PI1 
    WHERE 
      PI1.original_file_id = F1.id
  ) AS file_alt, 
  F2.id AS big_file_id, 
  F2.path AS big_file, 
  (
    SELECT 
      PI2.alt 
    FROM 
      `cscart_products__images` PI2 
    WHERE 
      PI2.watermark_big_file_id = F2.id
  ) AS big_file_alt, 
  F3.id AS small_file_id, 
  F3.path AS small_file, 
  (
    SELECT 
      PI3.alt 
    FROM 
      `cscart_products__images` PI3 
    WHERE 
      PI3.watermark_small_file_id = F3.id
  ) AS small_file_alt 
FROM 
  `cscart_products__images` AS `PI` 
  LEFT JOIN `files` AS `F1` ON `F1`.`id` = `PI`.`original_file_id` 
  LEFT JOIN `files` AS `F2` ON `F2`.`id` = `PI`.`watermark_big_file_id` 
  LEFT JOIN `files` AS `F3` ON `F3`.`id` = `PI`.`watermark_small_file_id` 
WHERE 
  `PI`.`product_id` = 25593

Query time 0.01156

Result

product_id file_id file file_alt big_file_id big_file big_file_alt small_file_id small_file small_file_alt
25593 277566 https://s3.timeweb.cloud/482029f9-prod/products__images/25593_aec41ebe4d8b_processed_ccf8d7be95fd4e839bae18db0f2f3727.jpeg 277576 https://s3.timeweb.cloud/482029f9-prod/products__images/25593_0d4c53eac8f9_processed_ccf8d7be95fd4e839bae18db0f2f3727.webp 277580 https://s3.timeweb.cloud/482029f9-prod/products__images/25593_1ccf44b2a74c_processed_ccf8d7be95fd4e839bae18db0f2f3727.webp
25593 277583 https://s3.timeweb.cloud/482029f9-prod/products__images/25593_537ed440e1e3_processed_6a344b54416f397890d4b78d8c11822c.jpeg 277593 https://s3.timeweb.cloud/482029f9-prod/products__images/25593_1cd29d5ca76f_processed_6a344b54416f397890d4b78d8c11822c.webp 277597 https://s3.timeweb.cloud/482029f9-prod/products__images/25593_be6152bd8fc1_processed_6a344b54416f397890d4b78d8c11822c.webp
25593 277600 https://s3.timeweb.cloud/482029f9-prod/products__images/25593_f5ad5b4991f0_processed_508359a853096d28775386a0f677f2ac.jpeg 277607 https://s3.timeweb.cloud/482029f9-prod/products__images/25593_85931ccada77_processed_508359a853096d28775386a0f677f2ac.webp 277611 https://s3.timeweb.cloud/482029f9-prod/products__images/25593_20fb328ff348_processed_508359a853096d28775386a0f677f2ac.webp