Would you be open to using pathlib?
pathlib is a python built-in library just like os and glob.
If a FileNotFoundError is raised for a file having the extension .png, it might not be an actual file, but rather a symlink pointing to the actual file.
In the event that you would like to sum the size of actual .png and avoid accounting for the (negligible) size of symlink that are pointing to .png files, you could detect symlink and avoid any computation based on them. (see below)
from pathlib import Path
ROOT_PATH = Path("C:\\")
_BYTES_TO_MB = 1024 ** 2
img_size_lst = []
img_size_mb_lst = []
for path_object in ROOT_PATH.glob("**/*.png"):
if path_object.is_symlink():
continue
else:
img_size_lst.append(path_object.stat().st_size)
img_size_mb_lst.append(path_object.stat().st_size / _BYTES_TO_MB)
print(sum(img_size_lst))
img_size_lst now includes the size, in bytes, of each images.
img_size_mb_lst now includes the size, in mb, of each images.