Files to which extracted images are written are currently opened in mode "w". They hsould be opened in mode "wb". This allows unrtf to work on platforms, like Windows, where files are opened by default in text mode.