Captcha image not refreshing on click

Permalink
I've redesigned my contact form into a Concrete5 package, added features etc. The captcha part used to work fine. And now the captcha image stopped refreshing on click, it simply disappears again. I had exactly the same problem before and it's been solved with the help of someone before (http://stackoverflow.com/questions/24982755/concrete5-securimage-image-not-refreshing-on-click).

Now I can't figure out why it stopped working again because the captcha display code is exactly the same, I did not touch it.

Here's what worked:

[view.php]
<div>
<img id="captcha_img" src="<?php echo $this->action('securimage'); ?>" /> 
<script>
$(function() {
    $('#captcha_img').click(function(){ 
        $(this).attr('src', '<?php echo $this->action('securimage'); ?>?time=' + (new Date).getTime());
    });
});
</script>
</div>

[controller.php]
protected $securimage;
public function action_securimage() {
    Loader::library('3rdparty/securimage/securimage');
    $this->securimage = new securimage();
    $this->securimage->show();
}

... and now it does not. Please help. Thank you.

linuxoid