udpated the promise object and fixed the load images function