Get Image Type from Buffer