The nature of giant clumps in distant galaxies probed by the anatomy of the cosmic snake