More robust retina file naming

Previous str_replace() retina file naming causes errors if the path
contains periods (.), so replaced retina file name creation with pathinfo() and rebuild.

Also some typo and spacing fixes.