Cleaned up some code. Wrapped a compare image method.