diff --git a/public_html/templates/post-content.tpl b/public_html/templates/post-content.tpl
index fb7b74d1..ae37c090 100644
--- a/public_html/templates/post-content.tpl
+++ b/public_html/templates/post-content.tpl
@@ -1,43 +1,47 @@
-<% var postContentUrl = '/data/posts/' + post.name + '?x=' + Math.random() /* reset gif animations */ %>
+<%
+ var postContentUrl = '/data/posts/' + post.name + '?x=' + Math.random() /* reset gif animations */
+ var width;
+ var height;
+ if (post.contentType === 'image' || post.contentType === 'flash') {
+ width = post.imageWidth;
+ height = post.imageHeight;
+ } else {
+ width = 800;
+ height = 600;
+ }
+%>
- <% if (post.contentType === 'image') { %>
+
+
+ <% if (post.contentType === 'image') { %>
-
-
-
- <% } else if (post.contentType === 'youtube') { %>
+ <% } else if (post.contentType === 'youtube') { %>
-
- <% } else if (post.contentType === 'flash') { %>
+ <% } else if (post.contentType === 'flash') { %>
-
- <% } else if (post.contentType === 'video') { %>
+ <% } else if (post.contentType === 'video') { %>
-
<% if (post.flags.loop) { %>
-
- <% } else { console.log(new Error('Unknown post type')) } %>
+ <% } else { console.log(new Error('Unknown post type')) } %>
+
+
+