added image conversion function

currently there is a linker bug i can not explain...