Gallery Bug within a Repeater

I have a gallery inside a repeater. When this gallery is empty and the user inserts a new photo, when updating the repeater to see it immediately, the gallery loses the proportions of the photo leaving it huge:

//This code inserts the description of the photo into a database referenced to another bank profile

export function buttonComentario_click(event, $w) {
const idOfItem = event.context.itemId;
console.log(idOfItem);
let idPerfil = wixUsers.currentUser.id;
let comentss = $w(“#textBoxComentario”).value;
let dadosParaInserir = {
‘idPublicacoes’: idOfItem,
‘coments’: comentss,
‘idPerfil’: idPerfil
}
wixData.save(“Comentarios”, dadosParaInserir)
atualizaNumComentarios()

$w('#textBoxComentario').value = "" 
$w("#datasetComentarios").refresh() 

    . **catch** ((err) => { 

let errorMsg = err;
console.log(errorMsg)
});

}

//This code updates the repeater. Consider that the photo is a reference of the database where the user entered the description:

export function atualizaNumComentarios() {
$w(“#repeaterPublicacao1”).onItemReady(($w, itemData, index) => {
wixData.query(“Comentarios”)
.eq(“idPublicacoes”, itemData._id)
.find()
.then( function (results) {
console.log(results.items + “resultados itens atualiza curtit”)
$w(“#textNumComentrios”).text = results.length + " Comentários"
console.log(results.items)
if (results.length > 0) {
$w(“#boxComents”).expand();
console.log(“===0”)
} else {
$w(“#boxComents”).collapse();

                console.log(">0") 
            } 

        }) 
        . **catch** ((error) => { 

let errorMsg = error.message;
let code = error.code;
});
})
}