Add image upload, various improvements, bugfixes