The figure will not necessarily be rendered below the text! I suggest setting a boolean variable to "true" when the figure is typeset, and conditionally saying "above" or "below" depending on whether the variable has been set.