Backported latest security fixes from Kusaba X and fixed a bug where Latchan would fail in case of a failed image upload.
Updated the .htaccess file to make sense.