image encoding test fixes