Fixed some problems with the imageloading