Improved scan

Added a boolean check to Scan to ensure BeginInvoke isn't called when
the form is closed.
Also updated a check for image filetypes to be case insensitive.