Refactor into Image and ImageBuffer