image resizing made optional, various fixes