Moving file upload to an Angular directive

Instead of a global event listener
Changing image download code to be implemented via a directive
Converting image download link to a directive
Preventing attempt to load image when file dialog is cancelled