generalised renderImage