In case of Wordpress: It runs on the regular webserver hence with user www-data. So be sure that the directories your are uploading to are owned by this user or it has write permissions via group membership. In case of Wordpress chown -R www-data:www-data /var/www/wordpress/ would usually cover it, but probably your instance is set up a bid different.
In case of the image gallery, it requires read access only. Strange is that on the parent directory is says “No image in gallery” but when you enter the directory, the images are there .