s-sahara Could you also fix the defer-issue please. I think you only need to change the JavaScript loading code to this:
$event->data['script'][] = array(
'type' => 'text/javascript',
'charset' => 'utf-8',
'src' => DOKU_BASE.'lib/plugins/prettyphoto/js/jquery.prettyPhoto.js',
'defer' => 'defer',
'_data' => '',
);