added support for uploading images to FTP, added some comments