Recently, one of my website was hacked by someone who uploaded an image (shell.gif) to my server.
I have put server side validation to check file extension + mime type of the image. However, they are still able to upload shell script using gif extension again.
Is there any better way to validate image file programmatically if they have any shell script signature beside two methods i mentioned above?