Fixes #1109 Themes with same name

Tried a fix for this:
https://github.com/mybb/mybb/issues/1109
And here.

BTW, use `AND` instead of `and`. If you please...