Check f_img and wf_img inside the __getitem__ method for valid objects, as I assume one of the transformations are raising this error.
Given the code, I guess self_wf_l is empty, the loop is never executed, and wf_img is still initialized as None.