I'd write a method in the Activity, say
public void onImageClick(View view) {
ImageView image = (ImageView)view;
}
and in the xml design I'd simply put
android:onClick="onImageClick"
in every ImageView.
Of course, this can be optimized (creating a xml-design containing a fully formatted imageview the way you need it and simply <include> that imageview 50 times or derive your own ImageView etc, but as you said, you are a beginner in Android Studio, I'd go for the most simple approach here so you keep control of what's happening.