Fix crash on generating histogram for HDRI