Complete write jpg file