Fixed bug with cached images + flush