You should probably use the repeater field name.. however the code above will not magically work just setting that.
First you need to check what you’ve got in the $value variable.. I’m not sure this works but try doing a print_r($value); to see the values being saved. In the working example above the $value is just a post attachment ID. In your case with a repeater field I imagine it’s something more in line of an array or object which you’ll need to fetch the right value from.