Changed the way chunked upload and saving works, in order to bypass the MySQL's max_allowed_packet limitation.