Minor refactoring (not actually changing yet)
Write given image