fixing funtion.js loadNewImages function