problem updating image content inside a dialog box (image refresh)

problem updating image content inside a dialog box (image refresh)

I am trying to allow my image to be refreshed inside a dialog box.  It is refreshed fine outside of a dialog box.

  1. function edit_thumb() {
  2.   $("#imageThumbBox").dialog('destroy');
  3.   $("#imageThumbBox").dialog({
  4.     autoOpen: false,
  5.     closeOnEscape: true,
  6.     resizable: true,
  7.     height: 'auto',
  8.     width: 'auto',
  9.     buttons: {
  10.       'Edit Thumb': function() {    
  11.         $("#myThumbForm").submit();
  12.       },
  13.       Cancel: function() {
  14.        $(this).dialog('close');
  15.       }
  16.     },
  17.     close: function() {
  18.     },
  19.     open: function() {
  20.     }
  21.   });
  22.   var img = db_cgi_url + "/photo.cgi?do=view;ID=" + ID + ";" + new Date().getTime();
  23.   $("#myimage").attr("src", img);
  24.   $("#imageThumbBox").dialog('open');
  25.   return false;
  26. }

 
I would like it so that everytime my function "edit_thumb" is ran, the dialog box and all the contents are refreshed, especially the image inside of it. As of now, it just loads the image and when I try and change it with lines 23-24.  I get no such luck even when I move lines 23-24 inside line 20.  Any suggestions?