fix drawing outside of image area