code refactoring using resharper
fix image callback, closes #1