Add function to FileUtils that encodes paths.

Use this function to properly set the source of images in ImageViewer.