clean up some js, adjust inline image rendering