# How to improve simple macros to leave the surrounding text justification undisturbed

I have prepared a series of macros in order to simplify the incorporation of pictures into long documents. All of them are based onthe MWE below. However I have just noticed that the text following the pictures is no longer justified properly on the right margin. What is the good way to correct this? Obviously I would like the macros calling pictures to be neutral regarding the surrounding text.

\documentclass [draft]{article}
\usepackage{lipsum}
\usepackage[draft]{graphicx}
\newcommand{\ThreePicturesThreeCaptions}[7]{%
%Usage[7 arguments]{file1}{caption1}{file2}{caption2}{file3}{caption3}{global-caption}
\centering
\begin{figure}[htbp]
\centering
\begin{minipage}[b]{.3\textwidth}
\centering
\includegraphics[width=.98\linewidth] {#1}\caption {#2}
\end{minipage}
\begin{minipage}[b]{.3\textwidth}%
\centering
\includegraphics[width=.98\linewidth]{#3}\caption {#4}
\end{minipage}
\begin{minipage}[b]{.3\textwidth}
\centering
\includegraphics[width=.98\linewidth]{#5}\caption {#6}
\end{minipage}
\caption{#7}
\end{figure}
\raggedright
}%

\begin{document}
\lipsum[1]
\lipsum[1]
\end{document}

-
Remove the first \centering at the beginning and the \raggedright at the end of your macro. – clemens Aug 4 '13 at 10:22
It works... Can you please convert your suggestion into an answer, so I can close my question? – Yves Aug 4 '13 at 10:33

Your definition of \ThreePicturesThreeCaptions sets \centering before the {figure} environment and also (more important here) \raggedright after the {figure} environment. Both are not wanted. The effect of the \centering is cancelled by \raggedright, anyway, and \raggedright switches to -- well -- ragged right text. If you remove both everything should be fine.
\newcommand{\ThreePicturesThreeCaptions}[7]{%