Code:

<script>

  var imageURLid = '#paragraph-id'; 

  var images = ['#image-id'];

  var imageURL = document.querySelectorAll(imageURLid + " div p")[0].innerHTML;

  images.forEach(image => {document.querySelector(image + " img").src = imageURL;});

</script>