Made HDR image loader more robust.