function shift_lable_to_overlay(){
?>
<script>
(function($) {
  var target = document.querySelectorAll('.show-title');
  var observers = [];
  // configuration of the observer
  var config = { attributes: true, childList: true,  subtree: true  };

  for (var i = 0; i < target.length; i++) {
      // create an observer instance
      observers[i] = new MutationObserver(function(mutations) {
          mutations.forEach(function(mutation) {            
            $(mutation.addedNodes).find('.image-overlay-inside').each(function() {
              var imgLabel = $(this).closest('.avia_image').attr('aria-label').replace(/\-|_/g,' ');
              $(this).append(' <span class="overlay-title" >' + imgLabel + '</span>');
            });
          });
      });
      // pass in the target node, as well as the observer options
      observers[i].observe(target[i], config);
  }
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'shift_lable_to_overlay');