Added error and complete callbacks

I needed the ability to handle errors (a 404 in my case) on each lazy image.  While I was adding that I thought it might be useful for someone to have the "complete" callback, so I went ahead and added that as well.  I also simplified the logic to determine how many elements were left, because it needed to happen in the error handler.  I did not want to repeat the same logic and I thought this change was simpler than breaking it into a function.