ajax loader images and some logic