To reproduce....
- Create a label with nothing but an img tag in it.
The label (ie. the image in this case) will not be displayed and (if you have debugging on) you'll get an error - like this...
( ! ) Notice: Undefined index: 2414 in /var/www/moodle/stable19/course/lib.php on line 1344
Call Stack
- Time Memory Function Location
1 0.0016 125908 {main}( ) ../view.php:0
2 0.6145 21449208 require( '/var/www/moodle/stable19/course/format/topics/format.php' ) ../view.php:226
3 0.6979 22013340 print_section( ) ../format.php:130
Analysis...
In mod/label/lib.php, the label_update_instance() function strips all the tags from the content to create the label name. If there's nothing but tags, the name is empty and it fails to save it properly.
My suggestion would be to create an arbitrary name in this case (the word 'label' plus the id or somesuch).