created add image function in views to modularize code.

weeeeee
pyc