improve image conversion