[Refactored a little to try and mend issue with lightbox functionality in drupal]