To by stačilo s vyšším id_image
objevující se v prvním slotu:
INSERT INTO new_table
SELECT t1.id_image, t1.score, t1.stddev, t2.id_image,
t2.score, t2.stddev, t1.id_location
FROM old_table t1
JOIN old_table t2
ON t2.id_location = t1.id_location
AND t2.id_image < t1.id_image