JPEG is one of the most popular image compression techniques, with numerous applications ranging from medical imaging to surveillance systems. Since JPEG introduces the blocking artifacts to the decompressed visual signals, enhancing the quality of these images is of paramount importance. Recently, various deep neural networks have been proposed for JPEG image deblocking that can effectively reduce the blocking artifacts produced by the JPEG compression technique. However, most of these schemes could only handle decompressed images generated by a set of specific JPEG quality factor (QF) values employed in the network training process. Therefore, when the images are obtained by the JPEG QF values other than those used in the network training process, the performance of deep learning-based JPEG image deblocking schemes drops significantly. To address this, in this paper, we propose a novel deep learning-based blind JPEG image deblocking method, which employs out-of-distribution detection to perform deblocking efficiently for various quality factor (QF) values. The proposed scheme can distinguish between the decompressed images using the QF values used in the training set and those using the QF values not used in the training set, and then, a suitable deblocking strategy for generating high-quality images is developed. The proposed scheme is shown to outperform the state-of-the-art JPEG image deblocking methods for various QF values.