refactor(doc): use ffi binding in picdocument

this should fix the crash on android when opening an jpg file.