Fix for template based icons (PR #757)

Make sure we have a modTemplate object (we still should be able to use "not templated" resources).