Detect if file element exists when using chooseFileAtIndex