def image_reward(image_name, q_table, action=-1):
    """
    looks up image reward in Q_table
    e.g. image_reward('n01531178_1006', 5) returns 1.012576460838318
    """
    for _, row in q_table[q_table['class'] == image_name].iterrows():
        if action == -1:
            return row
        else:
            return row[action + 1]