<ul><li><strong>Root cause</strong>: <code>getModuleView()</code> built carousel HTML with hardcoded 3 <code>&lt;li&gt;</code> indicators regardless of actual image count. Bootstrap <code>c.next()</code> → <code>c.slide()</code> tried to access <code>.item</code> that did not exist → <code>undefined.offsetWidth</code> → TypeError.</li><li><strong>Fix</strong>: Dynamically build indicators and slides from <code>imgPath</code> array length. <code>data-ride="carousel"</code> and <code>.carousel({interval})</code> are only applied when there are 2 or more images. Single-image and no-image cases no longer auto-cycle.</li><li><strong>Fix</strong>: Added <code>$.parseJSON</code> try/catch guard on <code>data.image_path</code> to prevent JSON parse errors crashing the handler.</li><li><strong>Fix</strong>: Destroy previous carousel instance with <code>.carousel("pause").removeData()</code> before rebuilding to prevent stale event listeners on repeated modal opens.</li></ul>