Fix for null dereference in image loader.