Encode image paths.