Make the following changes in script,
function changePic() {
var square = document.getElementsByClassName("square");//had invalid markup
var selectBox = document.getElementById("selectBox");
var selectedItem = selectBox.options[selectBox.selectedIndex].value;
square[0].style.backgroundImage = "url("+selectedItem+")";//url should be inside quotes,added first element of the array
}