Invalid file handling

Fixed bug where a file without the same number of columns on every row
would still upload. Also fixed bug where you would have to refresh
twice to see the uploaded files displayed correctly.