Fix bad logic for finding a unique Image key