upload image pyramid building and fix code