get image file type by magic bytes