Fixed collection view issue in iOS 7.
Some of the code may be a little messy now, but it works. Also, images in collection view cells are no longer correctly scaled, so that needs fixing.