Duplicating the id is bad. Checking the meta_type is not perfect, but it is one step better.
Attach a file by drag & drop or click to upload