SELECT * FROM s01_Products AS prod
JOIN s01_ProductImages AS pimg
ON pimg.product_id = prod.id
JOIN s01_Images AS img
ON img.id = pimg.image_id
JOIN s01_ImageTypes AS type
ON type.id = pimg.type_id
JOIN s01_GeneratedImages AS gimg
ON gimg.image_id = img.id
WHERE prod.id = '33954'
AND type.code = 'image_01'