Better guards against invalid BitmapData