data wrappers and jpeg writing