refactoring: add @Nullable annotations
fix #3536: exhaustion of simultaneous AsyncTask thread pool

Image loading in gallery is now limited to 5 images at a time. Also, if
resources are freed, queued images load requests are also discarded.
Free resources and stop downloads when leaving cache activity
Use image CDN when computing image URL