                           '((forward-line 1)))
                       (back-to-indentation))))
 
-(defun spacemacs-buffer//center-line ()
-  "When point is at the end of a line, center it."
-  (let* ((width (current-column))
-         (margin (max 0 (floor (/ (- spacemacs-buffer--window-width width)
+(defun spacemacs-buffer//center-line (&optional real-width)
+  "When point is at the end of a line, center it.
+REAL-WIDTH: the real width of the line.  If the line contains an image, the size
+            of that image will be considered to be 1 by the calculation method
+            used in this function.  As a consequence, the caller must calculate
+            himself the correct length of the line taking into account the
+            images he inserted in it."
+  (let* ((width (or real-width (current-column)))
+         (margin (max 0 (floor (/ (- spacemacs-buffer--window-width
+                                     width)
                                   2)))))
     (beginning-of-line)
-    (insert (make-string margin ?\ ))
+    (insert (make-string margin ?\s))
     (end-of-line)))
 
 (defun spacemacs-buffer//insert-buttons ()

       (let ((margin (max 0 (floor (/ (- spacemacs-buffer--window-width
                                         banner-width) 2)))))
         (while (not (eobp))
           (insert (make-string margin ?\ ))
           (forward-line 1))))
     (buffer-string))))


    (when (or (not (eq spacemacs-buffer--last-width (window-width)))
              (not buffer-exists)
              refresh)
      (setq spacemacs-buffer--window-width (if dotspacemacs-startup-buffer-responsive
                                               (window-width)
                                             80)
            spacemacs-buffer--last-width spacemacs-buffer--window-width)
      (with-current-buffer (get-buffer-create spacemacs-buffer-name)
        (page-break-lines-mode)
