add share functionality, change image saving to downloads folder, simplify write-to-file method