Fixed all compiler warnings for imageloader code
Only log debug messages if "debugImageLoading" is set