You should not allow the user to upload an image while an image is already uploading. If the user uploads a bunch of images in a row, the last one is not currently kept, and it therefore constitutes a bug. In addition, if a user is allowed to upload another image while the first image is uploading (and the avatar in the page has not been replaced), they feel that their previous action was not correctly registered. You should check the `uploading` variable at this point.