Finished the algorithm to sort pngs into categories