wrap image-loading logic in an object