Added helper function WriteImage to Context struct

Something I've found useful so feel free to use if you wish.