Image encoding - tests