add error handling when image cannot load