Modified the code so that there would be no conflict with the original BitmapData potentially being modified.