Fixed multiple bugs and added ImageLoader class