fix custom template regression

Your recent changes for sanitization introduced a bug: theme specific templates are not listed anymore.
Please merge and release an update soon.
Thanks