Removed function declarations inside of for loop, added missing semicolons,added check to see if ctrl key is down with event.ctrlKey boolean when clicking on image