Check file exists before add it to DB.

Moved file info into new table.