fix proper loading of style templates within the application bundle

attempt to load templates from styles inside the application bundle first, then try the custom styles and finally revert to application defaults.