made gallery compatible with joomla 3.x