Consolidate logic from ImageListFragment and ImageGridFragment into a base class, ImageFragment.

Closes #66