If you're using any hash smaller than your file (not just md5), then it's always possible to have 2 different files that match. This is just from pigeonhole principle. No matter what you use there will be collision.
md5 is just bad because it's small so it's easier to generate this match. It's also a question of how easy is it to reverse engineer a match, which apparently md5 is worse for on pictures than I expected.
If you're using any hash smaller than your file (not just md5), then it's always possible to have 2 different files that match. This is just from pigeonhole principle. No matter what you use there will be collision.
md5 is just bad because it's small so it's easier to generate this match. It's also a question of how easy is it to reverse engineer a match, which apparently md5 is worse for on pictures than I expected.