Fixed the "null..." issue. I had menu icons disabled for my gallery via Config > Themes.
The plugin actually accounts for this but for whatever reason, there's a block of code outside the condition:
$annotate_icon_array['announcement'] = cpg_fetch_icon('announcement', 1);
$annotate_icon_array['configure'] = cpg_fetch_icon('config', 1);
$annotate_icon_array['update_database'] = cpg_fetch_icon('update_database', 1);
$annotate_icon_array['import'] = cpg_fetch_icon('download', 1);
$annotate_icon_array['manage'] = cpg_fetch_icon('edit', 1);
$annotate_icon_array['ok'] = cpg_fetch_icon('ok', 2);
$annotate_icon_array['cancel'] = cpg_fetch_icon('cancel', 2);
$annotate_icon_array['delete'] = cpg_fetch_icon('delete', 2);
This should be moved inside the brackets for
if ($CONFIG['enable_menu_icons'] == 2) {
and then copy this into the else clause
$annotate_icon_array['announcement'] = '';
$annotate_icon_array['configure'] = '';
$annotate_icon_array['update_database'] = '';
$annotate_icon_array['import'] = '';
$annotate_icon_array['manage'] = '';
$annotate_icon_array['ok'] = '';
$annotate_icon_array['cancel'] = '';
$annotate_icon_array['delete'] = '';
I also managed to get the textbox to wrap beneath the annotations if there isn't enough room going out to the side. Might be just me, but the annotations too close to the right tended to go off screen. The changes below solve it. You can see how it works here:
http://www.pftq.com/gallery/displayimage.php?pid=3044(the annotation to the far right wraps down instead)
The code is a bit long though:
In lib/photonotes.js
Replace the last couple lines of 'PhotoNote.prototype.PositionNote = function()' with:
// pftq: Wrap to bottom, not extend off-screen
var noteX = this.rect.left + this.YOffset + this.rect.width;
var noteY = this.rect.top - 4;
if(noteX+3*this.rect.width>this.maxRight) {
if(noteX+2*this.rect.width<this.maxRight) {
//this.gui.ElementNote.style.width=(this.rect.width*2-this.YOffset)+'px';
}
else if(noteX+this.rect.width-this.YOffset<this.maxRight&&
this.maxRight-noteX>30) {
//this.gui.ElementNote.style.width=this.maxRight-noteX-this.YOffset+'px';
}
else {
var noteWidth=this.rect.width*2;
if(noteWidth>this.maxRight/2)
noteWidth=this.rect.width;
if(noteWidth>this.maxRight/2) noteWidth=this.maxRight/2;
while(noteWidth<50) noteWidth=50;
noteX= this.rect.left + this.YOffset*2 + (this.rect.width-noteWidth)/2;
if(noteX+noteWidth>this.maxRight)
noteX = this.maxRight - noteWidth-this.YOffset;
if(noteX<0) noteX=0;
noteY = this.rect.top + this.rect.height + this.YOffset/2;
//this.gui.ElementNote.style.width=noteWidth+'px';
}
}
this.gui.ElementNote.style.left = noteX + 'px';
this.gui.ElementNote.style.top = noteY + 'px';
Change 'function PhotoNote(text,id,rect,annotator_name,annotator_id)' to
function PhotoNote(text,id,rect,annotator_name,annotator_id, maxRight)
Add above 'editable: true /* nibbler */' :
maxRight:maxRight, /* pftq */
Then in codebase.php, just add an extra $container_width argument to the following function calls:
var note = new PhotoNote(annotations[n].note, 'note' + n,...
var newNote = new PhotoNote(note_text, 'note' + n, new PhotoNoteRe...
Eh - sorry for all the code.

I didn't expect to change so much of it, but I hope someone finds it useful.
