This fixes the issue that filename of an uploaded image is not set correctly (#2 by @zenitraM).
Backward compatibility
It seems previously already uploaded without filenames will get duplicated when uploaded with filenames. If you prefer to avoid it, please use the old version.