imwrite, output fixes