*flush buffered image to prevent mem leak