I think the bottom picture shown above is set up perfectly.
By orienting the pump so that the output comes out the top, you have set up a natural gravity fed "priming" of the pump. Air bubbles will naturally float out the top, and they will not stay trapped in the pump head. You will never have a problem with cavitation or it not getting primed. On disconnect, any liquid will flow back down and out the bottom, ensuring that there is nothing left stagnant inside the pump head, prolonging the life of the pump. (assuming you CLEAN it thoroughly and let it air dry).