fixed bug when checking out-of-bounds frames im graphics definitions