moved loading gif markup into a directive