code: def register():
      
      signals.initialized.connect(initialized)
      try:
          signals.content_object_init.connect(detect_content)
          signals.all_generators_finalized.connect(detect_images_and_galleries)
          signals.article_writer_finalized.connect(resize_photos)
      except Exception as e:
          logger.exception('Plugin failed to execute: {}'.format(pprint.pformat(e)))
docs: Uses the new style of registration based on GitHub Pelican issue #314.