detect newline in image