Below, is some code I'm using on a work.
\documentclass[12pt,a4paper]{book}
\usepackage{graphicx}
\usepackage{bm}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{enumitem}
\graphicspath{ {./Pictures} }
\begin{document}
sdlaksdasdkj lasjdlakjsdlajçd çlaksdçlahsd ççajshdaçslkhdçlawhoqiw aosihdq+we+poikjlçaks
\begin{figure}[h!]
\centering
\includegraphics[scale=1]{SizeGraph.png}
\caption{Plot of size accordingly to the number of replications}
\end{figure}
kçlksdaºlçskdja ºsºçljas daihpoquwhejsdkabjboqu skjdbascoupreqweoru adpjncopowueyr cnjdpoouhwer ppouweyr hjaspdsaopoih wqpoihpf sdfapougepwqry fdasdfc
\begin{figure}[h!]
\centering
\includegraphics[scale=1]{PowerGraph.png}
\caption{Plot of size accordingly to the number of replications}
\end{figure}
\end{document}
The problem begins when I use the same code on book tex file, i.e.,
\documentclass[12pt,a4paper]{book}
\usepackage{graphicx}
\usepackage{bm}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{enumitem}
\usepackage{url}
\usepackage{listings,xcolor}
\begin{document}
\frontmatter
%\setcounter{section}{1}
\tableofcontents
\mainmatter
\chapter{Simulations}
\input{simulations.tex}
\appendix
\section{Ehm}
\input{Ehm.tex}
\backmatter
\begin{thebibliography}{99}
sdasdasçdasçdlkçalskdç
\end{thebibliography}
\end{document}
The simulation.tex file has the same code as the one I wrote at the beginning of this question. However, when I compile, the simulations section doesn't produce the same output, since the text that was supposed to show up between the pictures SizeGraph.png and PowerGraph.png, now appears before the first picture. How can I solve this problem?
Any help would be appreciated.

centerenvironment and use\captionof{figure}{...}. If you want to get help on a specific case, you will have to minimize your code a lot. Just show us the very problem. – LaRiFaRi Jul 08 '15 at 13:37figureenvironment, you will get the floating behaviour you are seeing right now. (btw. I am not recommending this. I never use any parameter inside\begin{figure}[]if it is not totally needed) – LaRiFaRi Jul 08 '15 at 14:02