More code cleanup, rename image to icon

Define ICON_PATH constant for maintainability in case resources/ folder
is later subdivided into resources/icons/.

References to 'image' replaced with 'icon' to be more specific.

Code block for determining icon path converted from nested switches
into self-executing anonymous function, which reduces code length by
2/3rds.