detect imagae externsion based on its first byte