caches devicePixelRatio to avoid images too small or too large. Closes #317