Woocommerce singe product custom gallery output works just on the first slide

Apparently, in order to make it work there’s a second file (product-thumbnails.php) using the same function, so if the default function is changed in one file, the second one must be updated too.