added some image conversion utilities