The HTML that is generated associated with images posted using the IMG tags is done in the file /includes/class_bbcode.php. In this file is a function called "handle_bbcode_img()."
You would also need to alter the PHP code to allow for the innerHTML of your div element to be passed as an option with the IMG tags, for example:
Code:
[IMG=image 04]http://localhost/demov4/images/misc/vbulletin4_logo.png[/IMG]
Another option would be to create a custom BBCode that will generate the HTML you desire.