Changed so that images always end with a newline