Try file hash code. You can store the original file hash code in the DB with the data and compare it against the input image. If it’s the same image they should have the same hash value.
1
solved How to compare an input image from user with a stored image on the database in C# [closed]