local p = {}
local function isnotempty(s)
return s and s:match( '^%s*(.-)%s*$' ) ~= ''
end
local function photomontage( frame )
local args = frame:getParent().args
local size = tonumber(args['size'] or '200') or 200
local border = tonumber(args['border'] or '1') or 1
local spacing = tonumber(args['spacing'] or '1') or 1
local color = args['color'] or 'black'
local color_border = args['color_border'] or 'black'
local position = (args['position'] or ''):lower()
local caption = args['text'] or ''
local text_background = isnotempty(args['text_background']) and args['text_background'] or '#F8F8FF'
local foot_montage = args['foot_montage'] or ''
local lastnum = nil
local rownum = nil
local floatstyle = nil
if( position == 'left' or position == 'right' or position == 'none') then