Added code to loadImgs fuction and searchFn to check network state before attempting to load any content