That is not a proper ID for an HTML element.
To select an h3 tag with the class "r" which seems to be what you are trying to do you should use document.getElementsByTagName() and loop through the results to find the one with the class "r", or document.getElementsByClassName() and loop through to find the one with the tag name "h3".
A much simpler and efficient solution would be to add jquery to your content scripts like:
"content_scripts": [
{
"matches": ["*://www.google.ca/*"],
"js":["jquery.js", "trial.js"]
}
Then you can set the "src" attribute of your element like this:
$('h3.r').attr('src', imgURL);