I wrote a javascript snippet as follows after reading replies from the webdriver google group:
wd.execute_script("document.getElementById('allImages').value = '../uploads/b31f8a31-9d4e-49a6-b613-fb902de6a823.jpg';")
Or as SamSam suggested in the comment:
image = wd.find_element_by_id("allImages")
wd.execute_script("arguments[0].value = 'foo.jpg';", image)
Answer from the webdriver google group:
Using the "execute_script" method is the recommended approach in this case.
No, none in WebDriver, since it aims to imitate a user and a user cannot set attributes directly.