function to remove image control