scripts: sd_fusing_rpi3: check file type before writing an image