added WriteImage helper to Context interface