What I am saying and trying to convey in my posts about your html is whatever you do it must be valid html. You can not place html somewhere and leave out table or table row or table cell statements expect the display to not whack out.
Like in your custom pal which is a div statement you tried putting two table rows but no opening or closing table statements so that broke things. Like for instance the html on your old site is old html 4 which came before xhtml and html5 which is the current now. Our application is 100% valid html5. We use alot of css3 and div tags to make things work over old hard coded html tables. We really do not use many tables anymore.
The only reason your html whacked things out is you where missing certain tags to open or close the tables correctly.
If you want me to look at why your site has an issue with mysqli being used on upload you can send ftp info as I can not replicate that anywhere and the code I posted is valid and it is safe for you to remove it is just a safety check that stuff is encapsulated correctly in a photo description with slashes etc