Making it more robust in case imgs are not loaded