Fix bug: images can be inserted right after uploading