Avoid having empty filenames, or filenames with extension only.
In this case, keep the original filename.