encode filenames properly, factor out pencil_icon