You have class="previewBulk" and document.getElementsByClassName("preview");
Your code assumes there will be as many elements of the class preview as there are for movieImg, but since you got the class name wrong, there are going to be zero such elements.