Instead of implementing image optimizing routines into your application, this could be achieved quite easily by using a cron.
31. March 2018
After adding online accounts in Gnome Settings mounts did not show up in filemanager (Nautilus).
18. May 2017
As I recently tried to define some apparmor rules on Ubuntu 16.04. I realized that the service was not working properly.