slideshow.js: fitting the image correctly, refactoring, fixing preload issues, ...

I just want to feed back some changes I made.
https://github.com/lupusmeatus/apps/commit/3025f01fa7123842f5f3af0398ddeabb4cb5132f
is fixing #1073, #1074 
and some other issues.