Solution

imgName and imgname are two different variable in JavaScript. Similarly,

function mymethod(){
}
function myMethod(){
}

Similarly mymethod() and myMethod() are two different methods in JavaScript. In JavaScript the case sensitivity does not just apply to variable names and methods but also to JavaScript keywords, event handlers, and object properties.