This kind of pattern appears at least twice...add as a convenience method to ImageApi?