title: How to display new image in place of old after user uploads it?
body: <p>There are two conditionals involved here:</p>
  
  <p>1) When the user first enters the page, an image may <strong>not</strong> already be uploaded and nothing is shown.</p>
  
  <p>2) An image may already be uploaded, in which case it should show and be overridden in real time when a new image is uploaded to replace it.</p>
  
  <p>The whole uploading thing and displaying it right away is taken care of, <strong>it's just updating the image in case 2 that I'm struggling with.</strong></p>
  
  <p>When I upload the image, two things happen as can be seen here:</p>
  
  <pre><code>uploadImage('myDirective', d_canvas, 'image/png', function (error, downloadUrl) {
    if (! error) {
      Meteor.call('updateDatabase', versionId, downloadUrl)
      Session.set('imageAvailableAt', downloadUrl)
    }
  })
  </code></pre>
  
  <p>First it calls a method to update the database to add the new url. Second it sets the same url in a Session variable. Note that no matter if an image exists or not, the url will be the same and it will overridden automatically if it does.</p>
  
  <p>The image review looks like this in the template:</p>
  
  <pre><code>{{#with uploadedImage}}
    &lt;div class="preview-of-uploaded-image"&gt;
      &lt;img src="{{this}}"&gt;
    &lt;/div&gt;
  {{/with}}
  </code></pre>
  
  <p>And the helper:</p>
  
  <pre><code>var image = Session.get('imageAvailableAt')
  return image
  </code></pre>
  
  <p>All right, this takes care of <strong>case 1</strong>, and it will display the image very neatly when it is uploaded.</p>
  
  <p>But clearly nothing will show when an image is already uploaded here, and I have played with setting the same Session variable on <code>onRendered</code>, but then it won't update when I upload something new. I've tried different Session variables and conditionals but no luck. I've also tried <code>Tracker.autorun</code> but that doesn't work at all as described in the docs so I gave that up pretty quickly as well.</p>
  
  <p>What should I do?</p>