Various medical image retrieval systems are available today that classify images according to imaging modalities, orientations, body parts or diseases. Generally these are limited to either some specific body part or some specific disease. Further, almost all of them deal with the DICOM imaging format. In this paper, we introduce an algorithm based on energy information obtained from Wavelet Transform for classification of medical images according to imaging modalities and body parts. We have used two types of wavelets and we have shown that energy obtained in either case is quite distinct for each of the body part. This technique can be successfully applied to different image formats. The results are shown for JPEG images in addition to DICOM imaging format.