validate input and new image