Cleanup Bitmap_Get_Frame - based on https://code.google.com/p/3doh/source/detail?r=22