This is only a suggestion as I have not tested it:
Open class_bbcode.php
find:
PHP Code:
<a href=\"{$this->registry->options['bburl']}/attachment.php?{$this->registry->session->vars['sessionurl']}attachmentid=\\1&d=$attachment[dateline]\" $addtarget><img src=\"{$this->registry->options['bburl']}/attachment.php?{$this->registry->session->vars['sessionurl']}attachmentid=\\1&thumb=1&d=$attachment[thumbnail_dateline]\" class=\"thumbnail\" border=\"0\" alt=\""
. construct_phrase($vbphrase['image_larger_version_x_y_z'], $attachment['filename'], $attachment['counter'], $attachment['filesize'], $attachment['attachmentid'])
. "\" " . (!empty($align) ? " style=\"float: $align; margin: 2px\"" : 'style="margin: 2px"') . " /></a>
From that line down you will find quite a few entries referring to [img] bbcode.
Then alter how you see fit with border and such. Hopefully it will do what you want.
If I am wrong in this suggestion, someone please correct me.