added error message then trying to get pixels and graphic is null