Changed error message on failure and made test more robust

Suggested Reviewers: @wedaly @jzoldak 
Made the image upload test a bit more robust and added in the ability for the value obtained to be printed in case of an error.  

The javascript injection is because in some cases, we hide the actual input-form button and selenium will complain on some browsers.  For the upload file function, I follow the guidelines from upload.py