Thanks for your answer. Actually I'm senior Java and web(no designer) developer (but GMS rookie) I just couldn't connect the question and your first answer.
So you proposed that database is behind a web site and GMS reads the image from the gallery and uploads it via HTTP(S) to the website which saves it in the database?
Basically, yes. GMS has some functions like http_get and http_post_string for making web requests, there's quite a bit of information if you google those. In fact, if you're a web developer, you may prefer to use the http_request function which lets you compose all the http headers and stuff yourself in case there's any custom information you want to include.
There's also the question of how to actually work with the data for a picture. GML isn't generally keen on you doing that, but if you look up the section of the manual on buffers, the buffer_get_surface command and the buffer_base64_encode command will let you convert a picture to a stream of text. It won't be compressed at all, but it's the only way I know of so far to get picture data.
I'm not sure what was meant by 'the gallery' in the first question - given the ensuing conversation, I had the idea it meant uploading a screenshot during the game. If the intention is for a mobile game to access the mobile phone's gallery, I think you'll need an extension for that. If you search the marketplace, I expect you'll find such extensions available, although they might not be free. Being a Java developer, you may be able to make extensions for the Android phone yourself, though I don't have experience of that. Clearly stuff like that is possible - this extension offers access to the camera in gamemaker, for example:
https://marketplace.yoyogames.com/assets/1359/android-camera