Fix two bugs which were
1 : If the user creates new object, the text box  pops up, and then the user presses the button of next image,
     the text box will not close and stay on next image.
2 : the lag of typing that user has to press enter twice to input

Codes changed:
1. At the beginning of  loadNextImage function, added four statements for bug 1
2. Used a new var named textBoxClosed to keep track of whether user pressing enter or not
    variable popUp and its related codes are deleted.
3. Some comments explain how the autocomplete works