TypeError: null is not an object (evaluating 'e[D]')

Also possibly a cleaner way without wiping innerHTML is to do it like

buttonDiv.childNodes[1].childNodes[0].style.backgroundImage = `url(' ${picPath}')`;
buttonDiv.childNodes[1].childNodes[0].style.backgroundSize = "200px 120px";
buttonDiv.childNodes[1].childNodes[0].title= `Image ${(btnCntr + 1)}.jpg`

To understand how I am writing this : url(' ${picPath}')

see :