add loadImages function to utils.