Fix system.img not being detected in some scenarios