Convert bitmap source to png to suit the ximage which requires a file