Added a delay to showConfirm() so the image would load before the alert ...

$scope.mainImg would only update if you hit "cancel" after an end-condition was hit.  This was due to the alert blocking the code.

I inserted a timeout so the image swap occurs and the DOM updates before the alert blocks the code.