This is a crude example, but unfortunately iframes don't quite function properly in JSFiddle so we'll just have to pretend that <div class='iframe'></div>
is actually an iframe: http://jsfiddle.net/d74cah5z/3/
Essentially in your image upload function, you would create a new var image = Image();
variable and then set image.url
equal to the URL the user has inputted. There's then an onload and an onerror function, one of which will fire depending on whether the image was uploaded properly. In the onload function, you would set the src attribute of your <img>
container equal to image.url. If instead the onerror() function is fired, you would call your error function that's in your parent document, using parent.ImageError()
Hope that helps.