I asked a while ago, whether it’s feasible to get another file to generate a given hash.
The answer is no. Not even with MD5.
Just be very sure that this is the guarantee you are looking for. Often, for Merkle Trees etc. that is EXACTLY what is needed.
Can someone craft input files (eg images) to fool your system? Yes, but only at their own expense.
Sometimes if you want the system to be resilient even in the fact of malicious inputs then yes, you should use SHA256 and higher.