Add a return clause to prevent later code failure in getImageData