converting images to labels