Merge "Revert "Fix NPE when attach thumbnail"" into main