Incorrect imageURI is returned for hats in certain cases
Function `getImageURIForHat()` should return the most relevant imageURI for the requested hatId. It will iterate backwards from the current level down to level 0, and return an image if it exists for that level.\\n```\\n            function getImageURIForHat(uint256 _hatId) public view returns (string memory) {\\n                // check _hatId first to potentially avoid the `getHatLevel` call\\n                      Hat memory hat = _hats[_hatId];\\n                        string memory imageURI = hat.imageURI; // save 1 SLOAD\\n                // if _hatId has an imageURI, we return it\\n                            if (bytes(imageURI).length > 0) {\\n                return imageURI;\\n                }\\n                // otherwise, we check its branch of admins\\n                        uint256 level = getHatLevel(_hatId);\\n                // but first we check if _hatId is a tophat, in which case we fall back to the global image uri\\n                if (level == 0) return baseImageURI;\\n                // otherwise, we check each of its admins for a valid imageURI\\n                     uint256 id;\\n                // already checked at `level` above, so we start the loop at `level - 1`\\n                for (uint256 i = level - 1; i > 0;) {\\n                     id = getAdminAtLevel(_hatId, uint8(i));\\n                        hat = _hats[id];\\n                            imageURI = hat.imageURI;\\n                if (bytes(imageURI).length > 0) {\\n                      return imageURI;\\n                 }\\n                // should not underflow given stopping condition is > 0\\n                    unchecked {\\n                         --i;\\n                    }\\n             }\\n                // if none of _hatId's admins has an imageURI of its own, we \\n            again fall back to the global image uri\\n                return baseImageURI;\\n            }\\n```\\n\\nIt can be observed that the loop body will not run for level 0. When the loop is finished, the code just returns the baseImageURI, which is a Hats-level fallback, rather than top hat level fallback. As a result, the image displayed will not be correct when querying for a level above 0, when all levels except level 0 have no registered image.
Before returning the baseImageURI, check if level 0 admin has a registered image.
```\\n            function getImageURIForHat(uint256 _hatId) public view returns (string memory) {\\n                // check _hatId first to potentially avoid the `getHatLevel` call\\n                      Hat memory hat = _hats[_hatId];\\n                        string memory imageURI = hat.imageURI; // save 1 SLOAD\\n                // if _hatId has an imageURI, we return it\\n                            if (bytes(imageURI).length > 0) {\\n                return imageURI;\\n                }\\n                // otherwise, we check its branch of admins\\n                        uint256 level = getHatLevel(_hatId);\\n                // but first we check if _hatId is a tophat, in which case we fall back to the global image uri\\n                if (level == 0) return baseImageURI;\\n                // otherwise, we check each of its admins for a valid imageURI\\n                     uint256 id;\\n                // already checked at `level` above, so we start the loop at `level - 1`\\n                for (uint256 i = level - 1; i > 0;) {\\n                     id = getAdminAtLevel(_hatId, uint8(i));\\n                        hat = _hats[id];\\n                            imageURI = hat.imageURI;\\n                if (bytes(imageURI).length > 0) {\\n                      return imageURI;\\n                 }\\n                // should not underflow given stopping condition is > 0\\n                    unchecked {\\n                         --i;\\n                    }\\n             }\\n                // if none of _hatId's admins has an imageURI of its own, we \\n            again fall back to the global image uri\\n                return baseImageURI;\\n            }\\n```\\n