Simply paste the following code on your theme functions.php file, save it, and the <p> tags are gone.

function filter_ptags_on_images($content){
    return preg_replace('/<p>s*(<a .*>)?s*(<img .* />)s*(</a>)?s*</p>/iU', '123', $content);
}

add_filter('the_content', 'filter_ptags_on_images');

Thanks to James for the great hack!

About The Author

Jim Callender is a Freelance Wordpress Developer. Living & working in Brighton. He started working with Wordpress in 2003. Since then has been responsible for delivering high profile sites for a number of large UK design & marketing agencies. His other site is www.jayonline.co.uk