resolved JSHint issues
resolved JSHint issues (removed two unused vars, added semicolons)
WIP: upload works but event listener is added in wrong place
restored previously removed variable and re-used them to add event listener in a better place