Should be something more along the lines of, if len(d[value])>1 and then add cases for imgs and whatnot.