Scroll to uploaded file in file list

When files are uploaded, the cursor scrolls down to the last one and make it blink.

fixes #733
I corrected this portion of code but I can't figure out a proper test to be sure that there is no infinite loop. @PVince81 do you have any suggestion about it?