java get image type from byte array