Only clear when the native file input is cleared

While we are at it, I've added an option to delay the clearing of the view until either a new file is selected or the file dialog cancel (and having a previous file selected so the file input clears) and resetting to initial empty or preview view. So by setting 'clearOnBrowse' to false the UI will not change until the dialog is closed. Let me know if you see any problems with this approach.