As long as you hold the extension correctly (and your users carefully update their browser), image injection should not be possible.
For example, if someone uploads alert('xss');as an image, and you have it <img src='that-image.png'>, it will be released as png, and JavaScript will not execute (at least back in IE7). The important thing is that you rename images correctly.
If you have php> 5.3 and the finfoPECL extension , you can use it to get the type of mime file and have a white list of types that you allow (png, jpg, gif, I would imagine). If you are on a Linux machine, it filecan help you with that.
source
share