Convert file to image