Moved code for image lazy loading to a separate angularjs service.

This code currently only works when entries are closed by default (the default configuration).