I agree with kyllagdrgn – this plugin shouldn’t be manually concatenating the pieces of the URL when there’s a proper hook to fetch it.
Is there an easy way to handle this in functions.php instead of in the plugin’s code? It looks like the S3 and Cloudfront plugin uses wp_get_attachment_url to load the proper URL.