Added stitches argument. Restructure image prep