Adding callbacks to loading images