better implementation of lazy image loading, closes #50