[tools] Fixed iterating through the available hex files