diff --git a/my_plugins/photos/photos.py b/my_plugins/photos/__init__.py
similarity index 97%
rename from my_plugins/photos/photos.py
rename to my_plugins/photos/__init__.py
index 5692d3ce23701524b62e39761521da50bd8f44d9..2dcf4ae2767fe6c2c9d29fe77ee5aaba1a41144e 100644
--- a/my_plugins/photos/photos.py
+++ b/my_plugins/photos/__init__.py
@@ -402,6 +402,11 @@ def galleries_string_decompose(gallery_string):
 
 def process_gallery(generator, content, location):
 
+    RE_PHOTO = re.compile('.*\.jpg', re.I)
+    RE_VIDEO = re.compile('.*\.mp4', re.I)
+    RE_HIDDEN_FILE = re.compile('^\..*')
+    RE_TEXT_FILE = re.compile('.*\.txt', re.I)
+
     content.photo_gallery = []
 
     galleries = galleries_string_decompose(location)
@@ -439,18 +444,15 @@ def process_gallery(generator, content, location):
 
             title = gallery['title']
             for item in sorted(os.listdir(dir_gallery)):
-                if item.startswith('.'):
-                    continue
-                if item.endswith('.txt'):
+                if any(regex.match(item) for regex in (RE_HIDDEN_FILE, RE_TEXT_FILE)):
                     continue
                 if item in blacklist:
                     continue
-                if item.endswith('.mp4.jpg'):
-                    if os.path.isfile(
-                         os.path.join(dir_gallery, os.path.splitext(item)[0])):
-                        continue
+                if RE_VIDEO.match(item) and os.path.isfile(
+                     os.path.join(dir_gallery, os.path.splitext(item)[0])):
+                    continue
                 thumb = os.path.splitext(item)[0] + 't.jpg'
-                if item.endswith('.jpg'):
+                if RE_PHOTO.match(item):
                     enqueue_resize(
                         os.path.join(dir_gallery, item),
                         os.path.join(dir_photo, item),
@@ -459,7 +461,7 @@ def process_gallery(generator, content, location):
                         os.path.join(dir_gallery, item),
                         os.path.join(dir_thumb, thumb),
                         generator.settings['PHOTO_THUMB'])
-                elif item.endswith('.mp4'):
+                elif RE_VIDEO.match(item):
                     enqueue_copy(
                         os.path.join(dir_gallery, item),
                         os.path.join(generator.output_path, dir_photo, item),
diff --git a/pelicanconf.py b/pelicanconf.py
index bee56d0b7ab90a0c8876d493ca750cc4ad77324e..a2a2cfde7044d591d1ac7177a7c340bfe2b448ff 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -9,7 +9,7 @@ SITENAME = 'Anton Sarukhanov'
 SITESUBTITLE = 'Full-Stack Developer'
 SITEURL = os.environ.get('SITEURL')
 
-PLUGIN_PATHS = ['plugins']
+PLUGIN_PATHS = ['my_plugins']
 PLUGINS = ['advthumbnailer', 'photos']
 
 # Photos