Add rebuild command

I needed to add the rebuild command. I have also added the fuzzy detection of the image.