Image/video preview

hi, this question may sound difficult to understand so please tell me if you don’t understand something. I am trying to create a sort of image and video preview. what i want is that when you click an image thumbnail the full image will appear in the center of that page. when viewing this picture the background will be a grey colour putting the focus on the picture. when you click outside the picture nothing will because you can on go out of the picture by clicking the custom X button with the picture, the same thing goes for the video. You may have seen something like this when reading an online manga when you click on the image it becomes full screen and you ‘x it’ you come out of it.

hope you understood this.

Please reply as soon as possible