Your collection syntax is fine, but in a SharePoint form/gallery, Image1, Image2, etc. are usually fields of the current record. You need to reference the record explicitly and filter out blank images.
ClearCollect(
MyImageCollection,
{Name:"Image1", Image: ThisItem.Image1},
{Name:"Image2", Image: ThisItem.Image2},
{Name:"Image3", Image: ThisItem.Image3},
{Name:"Image4", Image: ThisItem.Image4},
{Name:"Image5", Image: ThisItem.Image5},
{Name:"Image6", Image: ThisItem.Image6},
{Name:"Image7", Image: ThisItem.Image7},
{Name:"Image8", Image: ThisItem.Image8}
);
RemoveIf(MyImageCollection, IsBlank(Image));
Set the Gallery.Items property to : MyImageCollection
For slideshow navigation:
Next button
Set(varIndex,
If(varIndex < CountRows(MyImageCollection),
varIndex + 1,
1
)
)
Set(varIndex,
If(varIndex > 1,
varIndex - 1,
CountRows(MyImageCollection)
)
)
Image control
Last(FirstN(MyImageCollection, varIndex)).Image
If your SharePoint image columns are modern Image columns, the field may need to be referenced as: ThisItem.Image1.Full instead of ThisItem.Image1. That's the most common reason the collection appears not to work.