Changes to comply with pull request
Temporary fix for buffer artifacts when drawing an image smaller than a previously rendered image