implemented remove image function