Image processing fixes