Latest working code with ImageLoader class