Fix broken captcha and use class

Captcha was broken by this commit: https://github.com/joomla/joomla-cms/commit/acb7e30fd79ea1dc8a40aff858751ca4f52f8b40

which reversed the order of id and class for code style. To fix this i've given class a default empty string value and used it in the method