added logic to save image on double-tap and undo last shape on swipe