Passing variable as add_shortcode argument

There are two solutions:

  1. Use the third argument for the shortcode.
  2. Use the use keyword.

Examples

  1. The third parameter for each shortcode callback is the name of the shortcode:
foreach ($files1 as $value) {
    $new_value = substr($value, 0, -4);

    add_shortcode($new_value, function( $attributes, $content, $shortcode ) {
        return '<img src="' . PATH . L_ITEMS . $shortcode . '.gif">';
    });
}
  1. Pass the variable you need to the use part of the lambda function:
foreach ($files1 as $value) {
    $new_value = substr($value, 0, -4);

    add_shortcode($new_value, function() use ( $new_value ) {
        return '<img src="' . PATH . L_ITEMS . $new_value . '.gif">';
    });
}

I think you should register just one shortcode and pass the file as attribute value. That would be faster and easier to debug.