Improving efficiency of ghost imaging by tapping into the obtained data