Remove ‘p’ tags around shortcodes and ‘img’

First, what you are trying to do is an abuse of the shorcode system. You should not use them to replace html elements.

That aside, the p comes from the content. You either need to use [div]....[/div] and than you will get the content as the second parameter to the shortcode function and you can format it anyway you want. This is how the first shortcode works in your example.