Improve image loading performance by reducing filesystem access