On any nonconforming structure or portion of a structure containing a nonconforming use, work may be done on ordinary repairs, or on repair or replacement of non-bearing walls, fixtures, wiring, or plumbing, provided that the cubic content existing when it became nonconforming shall not be increased. Nothing in this section shall be deemed to prevent the strengthening or restoring to a safe condition of any building or part thereof declared to be unsafe by any official charged with protecting the public safety, upon order of such official.