Changed code to work with classes

filters out main photos