Remove redundant variables.
Fix crash on failure to get frame B's image. (SF-213)
Fix crash on failure to get B frame image. (SF-213)