Tore,
Thanks for the filetype() function. I added "BM" for "BMP". Also, did you see Michel's post on JPG detection? It looks like he found JPG files that used a shorter version of your JPG detection string, specifically hex "FFD8" vs. your longer header constant.
Malcolm