Added loader and made ajax asynchrnous again. Loader image will not show if done synchronously for some reason. Just too much going on for the browser to update the image style. Tried to use setTimeOut to give it some time to do it but it refused to do it even then