Improve isPreload method to support deep dependencies