Sticking to MD5 is a good idea. Just to make sure that I add the file length or the number of pieces to your file hash table.
Yes, it is likely that you will encounter two files that have the same MD5 hash, but this is unlikely (if your files are of a decent size). Thus, adding the number of fragments to the hash can help you reduce this, since now you need to find two files of the same size with the same MD5.
To reduce this possibility, switch to SHA1 and use the same method. Or even use both (concatenation) if performance is not a problem.
Of course, keep in mind that this will only work with duplicate files at the binary level, and not with images, sounds, videos that are "the same" but have different signatures.
source share