BugFixes

Fixed bug that we were computing difference in images with wrong
template. Added error code that tells us if we hit the max number of
iterations. Fixed gitignore file.