Fix image class not using Joomla tmp directory when it's possible