(a) Section 13A-11-42 does not apply to viewing, photographing, or filming by personnel of the Department of Corrections or of a local jail or correctional facility for security purposes or during investigation of an alleged misconduct by a person in the custody of the Department of Corrections or the local jail or correctional facility.
(b) Notwithstanding ordinary rules of court and preservation of evidence, if a person is adjudicated or convicted of a violation of Section 13A-11-41 or Section 13A-11-42, a court may order the destruction of any photograph, motion picture film, digital image, digital video, videotape, or any other recording of an image that was made by the person in violation of this article; provided that the victim, or victim's representative, is provided with written notice 90 days before the destruction is to occur. Except as prohibited by state or federal law, the victim, or victim's representative, shall retain the right to possess any photograph, motion picture film, digital image, videotape, or any other recording of an image.