PHP5.4 warning fixes and a jquery fix for the jgallery version