You already did with that line:
android:gravity="center"
With that line you already Center the ImageView
horizontal and vertical.
If you just want one of them use for example:
android:gravity="center_horizontal"
I don't know what exactly is your Problem, we do not even know
android:layout_width="@dimen/custom_photo_item_size"
which value is declared in your dimensions.xml
...
If you want to Center your whole Item
you would Need to declare:
android:layout_gravity="Center"
but this doesn't make any sense as you only have one layout in a GridView-Cell
and you declared your rootView
of your Item as
android:width="match_parent" android:height="match_parent"
So this is just an info for you ;)
Provide more Infos if you want better Support. Hope it helps anyway
Adapter's xml parent layout set android:layout_width="match_parent" android:layout_gravity="center_horizontal"