copy correct number of bytes in encode_exif()