head img taking too long to load due to js