Trying to write out images