Converts images to data URIs